From a6cf1e709b96865210b81bd611d41e9a2d41500a Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 2 Dec 2010 02:45:55 +0000 Subject: Add support for the common and nocommon attributes. rdar://8560647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120650 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index a3cf69b675..1dab027455 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1214,7 +1214,9 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D, // FIXME: It seems like we can provide more specific linkage here // (LinkOnceODR, WeakODR). return llvm::GlobalVariable::WeakAnyLinkage; - else if (!getLangOptions().CPlusPlus && !CodeGenOpts.NoCommon && + else if (!getLangOptions().CPlusPlus && + ((!CodeGenOpts.NoCommon && !D->getAttr()) || + D->getAttr()) && !D->hasExternalStorage() && !D->getInit() && !D->getAttr() && !D->isThreadSpecified()) { // Thread local vars aren't considered common linkage. -- cgit v1.2.3-18-g5258