forked from OSchip/llvm-project
IRGen: Do not set dllexport on declarations.
Setting dllexport on a declaration has no effect, as we do not emit export directives for declarations. Part of the fix for PR32334. Differential Revision: https://reviews.llvm.org/D31162 llvm-svn: 298330
This commit is contained in:
parent
c12716e742
commit
dc205b3db2
|
@ -1036,7 +1036,6 @@ static void setLinkageAndVisibilityForGV(llvm::GlobalValue *GV,
|
||||||
GV->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
|
GV->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
|
||||||
} else if (ND->hasAttr<DLLExportAttr>()) {
|
} else if (ND->hasAttr<DLLExportAttr>()) {
|
||||||
GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
|
GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
|
||||||
GV->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
|
|
||||||
} else if (ND->hasAttr<WeakAttr>() || ND->isWeakImported()) {
|
} else if (ND->hasAttr<WeakAttr>() || ND->isWeakImported()) {
|
||||||
// "extern_weak" is overloaded in LLVM; we probably should have
|
// "extern_weak" is overloaded in LLVM; we probably should have
|
||||||
// separate linkage types for this.
|
// separate linkage types for this.
|
||||||
|
|
|
@ -108,8 +108,8 @@ inline int __declspec(dllexport) inlineStaticLocalsFunc() {
|
||||||
template<typename T> __declspec(dllexport) int VarTmplDef;
|
template<typename T> __declspec(dllexport) int VarTmplDef;
|
||||||
INSTVAR(VarTmplDef<ExplicitInst_Exported>)
|
INSTVAR(VarTmplDef<ExplicitInst_Exported>)
|
||||||
|
|
||||||
// MSC-DAG: @"\01??$VarTmplImplicitDef@UImplicitInst_Exported@@@@3HA" = external dllexport global
|
// MSC-DAG: @"\01??$VarTmplImplicitDef@UImplicitInst_Exported@@@@3HA" = external global
|
||||||
// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external dllexport global
|
// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external global
|
||||||
template<typename T> __declspec(dllexport) int VarTmplImplicitDef;
|
template<typename T> __declspec(dllexport) int VarTmplImplicitDef;
|
||||||
USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>)
|
USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>)
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ struct __declspec(dllexport) T {
|
||||||
// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@T@@QAEXXZ"
|
// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@T@@QAEXXZ"
|
||||||
|
|
||||||
static int b;
|
static int b;
|
||||||
// M32-DAG: @"\01?b@T@@2HA" = external dllexport global i32
|
// M32-DAG: @"\01?b@T@@2HA" = external global i32
|
||||||
|
|
||||||
static int c;
|
static int c;
|
||||||
// M32-DAG: @"\01?c@T@@2HA" = dllexport global i32 0, align 4
|
// M32-DAG: @"\01?c@T@@2HA" = dllexport global i32 0, align 4
|
||||||
|
|
Loading…
Reference in New Issue