[PATCH] D31162: IRGen: Do not set dllexport on declarations.
Peter Collingbourne via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 20 18:05:13 PDT 2017
pcc created this revision.
Setting dllexport on a declaration has no effect, as we do not emit export
directives for declarations.
Part of the fix for PR32334.
https://reviews.llvm.org/D31162
Files:
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCXX/dllexport.cpp
Index: clang/test/CodeGenCXX/dllexport.cpp
===================================================================
--- clang/test/CodeGenCXX/dllexport.cpp
+++ clang/test/CodeGenCXX/dllexport.cpp
@@ -108,8 +108,8 @@
template<typename T> __declspec(dllexport) int VarTmplDef;
INSTVAR(VarTmplDef<ExplicitInst_Exported>)
-// MSC-DAG: @"\01??$VarTmplImplicitDef at UImplicitInst_Exported@@@@3HA" = external dllexport global
-// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external dllexport global
+// MSC-DAG: @"\01??$VarTmplImplicitDef at UImplicitInst_Exported@@@@3HA" = external global
+// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external global
template<typename T> __declspec(dllexport) int VarTmplImplicitDef;
USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>)
@@ -528,7 +528,7 @@
// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a at T@@QAEXXZ"
static int b;
- // M32-DAG: @"\01?b at T@@2HA" = external dllexport global i32
+ // M32-DAG: @"\01?b at T@@2HA" = external global i32
static int c;
// M32-DAG: @"\01?c at T@@2HA" = dllexport global i32 0, align 4
Index: clang/lib/CodeGen/CodeGenModule.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenModule.cpp
+++ clang/lib/CodeGen/CodeGenModule.cpp
@@ -1036,7 +1036,6 @@
GV->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
} else if (ND->hasAttr<DLLExportAttr>()) {
GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
- GV->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
} else if (ND->hasAttr<WeakAttr>() || ND->isWeakImported()) {
// "extern_weak" is overloaded in LLVM; we probably should have
// separate linkage types for this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31162.92412.patch
Type: text/x-patch
Size: 1780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170321/2190bc90/attachment.bin>
More information about the cfe-commits
mailing list