From c48d31c31c97dc3b0314f20f2b9c93d8277bfae5 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 1 Jul 2013 20:53:07 +0000 Subject: Simplify linkage code for static local vars. The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before. llvm-svn: 185381 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index cfb9e78..250442c 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -515,11 +515,7 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) { llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage(GlobalDecl GD) { - return getFunctionLinkage(cast(GD.getDecl())); -} - -llvm::GlobalValue::LinkageTypes -CodeGenModule::getFunctionLinkage(const FunctionDecl *D) { + const FunctionDecl *D = cast(GD.getDecl()); GVALinkage Linkage = getContext().GetGVALinkageForFunction(D); if (Linkage == GVA_Internal) -- cgit v1.1