summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 007dcf2df7d..19cdc24270c 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -240,6 +240,7 @@ llvm::Constant *CodeGenModule::getOrCreateStaticVarDecl(
getModule(), LTy, Ty.isConstant(getContext()), Linkage, Init, Name,
nullptr, llvm::GlobalVariable::NotThreadLocal, TargetAS);
GV->setAlignment(getContext().getDeclAlign(&D).getQuantity());
+ setGVProperties(GV, &D);
if (supportsCOMDAT() && GV->isWeakForLinker())
GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
@@ -254,8 +255,6 @@ llvm::Constant *CodeGenModule::getOrCreateStaticVarDecl(
GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
}
- setGVProperties(GV, &D);
-
// Make sure the result is of the correct type.
LangAS ExpectedAS = Ty.getAddressSpace();
llvm::Constant *Addr = GV;
OpenPOWER on IntegriCloud