[cfe-commits] r84140 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/CXX/temp/temp.spec/temp.explicit/p1-emit.cpp
Douglas Gregor
dgregor at apple.com
Wed Oct 14 14:36:50 PDT 2009
On Oct 14, 2009, at 2:34 PM, John McCall wrote:
> Douglas Gregor wrote:
>> +static CodeGenModule::GVALinkage
>> +GetLinkageForVariable(ASTContext &Context, const VarDecl *VD) {
>> + // Everything located semantically within an anonymous namespace
>> is
>> + // always internal.
>> + if (VD->isInAnonymousNamespace())
>> + return CodeGenModule::GVA_Internal;
>>
>
> If you're going to check for anonymous namespaces here....
>
>> @@ -1021,9 +1057,10 @@
>> GV->setAlignment(getContext().getDeclAlignInBytes(D));
>>
>> // Set the llvm linkage type as appropriate.
>> + GVALinkage Linkage = GetLinkageForVariable(getContext(), D);
>> if (D->isInAnonymousNamespace())
>> GV->setLinkage(llvm::Function::InternalLinkage);
>>
>
> You don't need to do it again here.
Good catch. Fixed in r84142.
- Doug
More information about the cfe-commits
mailing list