r328801 - Set dso_local when clearing dllimport.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 29 09:45:18 PDT 2018


Author: rafael
Date: Thu Mar 29 09:45:18 2018
New Revision: 328801

URL: http://llvm.org/viewvc/llvm-project?rev=328801&view=rev
Log:
Set dso_local when clearing dllimport.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/test/CodeGenCXX/dllimport.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=328801&r1=328800&r2=328801&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Mar 29 09:45:18 2018
@@ -2398,8 +2398,10 @@ llvm::Constant *CodeGenModule::GetOrCrea
     }
 
     // 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.

Modified: cfe/trunk/test/CodeGenCXX/dllimport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport.cpp?rev=328801&r1=328800&r2=328801&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport.cpp Thu Mar 29 09:45:18 2018
@@ -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()




More information about the cfe-commits mailing list