From d4b6e7a9b736539bf51f171c645a5ed8f66ae679 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 13 Jun 2013 21:50:44 +0000 Subject: Fix the linkage of static locals inside a CapturedStmt. (Found in the process of trying to fix the related issue for block literals.) llvm-svn: 183951 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index f6218cd..4865a91 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -510,7 +510,11 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) { llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage(GlobalDecl GD) { - const FunctionDecl *D = cast(GD.getDecl()); + return getFunctionLinkage(cast(GD.getDecl())); +} + +llvm::GlobalValue::LinkageTypes +CodeGenModule::getFunctionLinkage(const FunctionDecl *D) { GVALinkage Linkage = getContext().GetGVALinkageForFunction(D); if (Linkage == GVA_Internal) -- cgit v1.1