diff options
author | John McCall <rjmccall@apple.com> | 2011-04-12 01:46:54 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-04-12 01:46:54 +0000 |
commit | 99ace16bc6962f1fc3dc45bbbdf2eb74e555a8ad (patch) | |
tree | 84800e26bace4f942fa56acdc48fea63dd0a1f7a /lib/CodeGen/CodeGenModule.cpp | |
parent | 1d1a679090afe8468c6c95f8ab9c3192683ac69f (diff) |
Template static data members can have weak_odr linkage, not just
weak linkage. Also, fix a problem where global weak variables
with non-trivial initializers were getting guard variables, or at
least were checking for them and then crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d22991db04..f740f707e0 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1316,9 +1316,7 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D, return llvm::GlobalVariable::WeakAnyLinkage; } else if (Linkage == GVA_TemplateInstantiation || Linkage == GVA_ExplicitTemplateInstantiation) - // FIXME: It seems like we can provide more specific linkage here - // (LinkOnceODR, WeakODR). - return llvm::GlobalVariable::WeakAnyLinkage; + return llvm::GlobalVariable::WeakODRLinkage; else if (!getLangOptions().CPlusPlus && ((!CodeGenOpts.NoCommon && !D->getAttr<NoCommonAttr>()) || D->getAttr<CommonAttr>()) && |