From 7849eeb0359e086870633437529c7f8a6a30a952 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 14 Dec 2016 21:38:18 +0000 Subject: Revert 289252 (and follow-up 289285), it caused PR31374 llvm-svn: 289713 --- clang/lib/CodeGen/CodeGenModule.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') 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); -- cgit v1.2.3