Set dso_local when clearing dllimport.

llvm-svn: 328801
This commit is contained in:
Rafael Espindola 2018-03-29 16:45:18 +00:00
parent 7e9b87648b
commit c9643d8fc8
2 changed files with 5 additions and 1 deletions

View File

@ -2398,8 +2398,10 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(
}
// Handle dropped DLL attributes.
if (D && !D->hasAttr<DLLImportAttr>() && !D->hasAttr<DLLExportAttr>())
if (D && !D->hasAttr<DLLImportAttr>() && !D->hasAttr<DLLExportAttr>()) {
Entry->setDLLStorageClass(llvm::GlobalValue::DefaultStorageClass);
setDSOLocal(Entry);
}
// If there are two attempts to define the same mangled name, issue an
// error.

View File

@ -203,6 +203,8 @@ USEVAR(VarTmpl<ExplicitSpec_Imported>)
// Functions
//===----------------------------------------------------------------------===//
// GNU-DAG: declare dso_local void @_ZdlPv(i8*)
// Import function declaration.
// MSC-DAG: declare dllimport void @"?decl@@YAXXZ"()
// GNU-DAG: declare dllimport void @_Z4declv()