summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-03-29 16:45:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-03-29 16:45:18 +0000
commitc9643d8fc854555ad5711de84bcbfe91ed7ad256 (patch)
tree5352404ff03c025cc9e4bc885b9f1267f2e6e5ad
parent7e9b87648b4ec63c9d904d3518b0cbb2c674f735 (diff)
downloadbcm5719-llvm-c9643d8fc854555ad5711de84bcbfe91ed7ad256.tar.gz
bcm5719-llvm-c9643d8fc854555ad5711de84bcbfe91ed7ad256.zip
Set dso_local when clearing dllimport.
llvm-svn: 328801
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
-rw-r--r--clang/test/CodeGenCXX/dllimport.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index bc7ba9011ae..188648cecc9 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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.
diff --git a/clang/test/CodeGenCXX/dllimport.cpp b/clang/test/CodeGenCXX/dllimport.cpp
index dbe31d24280..74f58cc3b17 100644
--- a/clang/test/CodeGenCXX/dllimport.cpp
+++ b/clang/test/CodeGenCXX/dllimport.cpp
@@ -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()
OpenPOWER on IntegriCloud