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 | a97f32986913c07cac9c49b0b6b755b7190812b1 (patch) | |
tree | b186fabf5c2070c3ece88e6c820f55895b510e40 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | b4744a3f4d9bffebc671201b6c133f7464fb1c8e (diff) | |
download | llvm-a97f32986913c07cac9c49b0b6b755b7190812b1.zip llvm-a97f32986913c07cac9c49b0b6b755b7190812b1.tar.gz llvm-a97f32986913c07cac9c49b0b6b755b7190812b1.tar.bz2 |
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.
llvm-svn: 129342
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d22991d..f740f70 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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>()) && |