[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

John McCall rjmccall at apple.com
Wed Oct 14 14:34:50 PDT 2009


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.

John.



More information about the cfe-commits mailing list