diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 98b6215d0b4..78f43bdef99 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2611,16 +2611,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, else GV->setDLLStorageClass(llvm::GlobalVariable::DefaultStorageClass); - if (Linkage == llvm::GlobalVariable::CommonLinkage) { + if (Linkage == llvm::GlobalVariable::CommonLinkage) // common vars aren't constant even if declared const. GV->setConstant(false); - // Tentative definition of global variables may be initialized with - // non-zero null pointers. In this case they should have weak linkage - // since common linkage must have zero initializer and must not have - // explicit section therefore cannot have non-zero initial value. - if (!GV->getInitializer()->isNullValue()) - GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); - } setNonAliasAttributes(D, GV); |