]> granicus.if.org Git - clang/commitdiff
Set dso_local when clearing dllimport.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Mar 2018 16:45:18 +0000 (16:45 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Mar 2018 16:45:18 +0000 (16:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328801 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp
test/CodeGenCXX/dllimport.cpp

index bc7ba9011ae92ffa1aba5c982e5937770b2dce27..188648cecc99f145acb64d4d7860419176c2941d 100644 (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.
index dbe31d24280ce43c4ab3375ce6378022040e98d2..74f58cc3b17193298e1a0e3379c14aee2a4797e7 100644 (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()