diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-12-14 21:38:18 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-12-14 21:38:18 +0000 |
commit | 7849eeb0359e086870633437529c7f8a6a30a952 (patch) | |
tree | f6e8d655f9a1feba6677efeb815d749321625ee1 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 65aedad62862a356c49fc5457277fb0c9cd3a75a (diff) | |
download | bcm5719-llvm-7849eeb0359e086870633437529c7f8a6a30a952.tar.gz bcm5719-llvm-7849eeb0359e086870633437529c7f8a6a30a952.zip |
Revert 289252 (and follow-up 289285), it caused PR31374
llvm-svn: 289713
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); |