From 65ad5a42cca954e070428dcc499b62393aa7a6d3 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sun, 18 Apr 2010 21:01:23 +0000 Subject: Local static variables must be available module-wise as they are accessible in static methods in a class local to the same function. Fixes PR6769. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.h') diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 8db5a588d0..022360bfc5 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -133,6 +133,7 @@ class CodeGenModule : public BlockModule { llvm::StringMap CFConstantStringMap; llvm::StringMap ConstantStringMap; + llvm::DenseMap StaticLocalDeclMap; /// CXXGlobalInits - Global variables with initializers that need to run /// before main. @@ -170,6 +171,14 @@ public: /// been configured. bool hasObjCRuntime() { return !!Runtime; } + llvm::Value *getStaticLocalDeclMap(const VarDecl *VD) { + return StaticLocalDeclMap[VD]; + } + void setStaticLocalDeclMap(const VarDecl *D, + llvm::GlobalVariable *GV) { + StaticLocalDeclMap[D] = GV; + } + CGDebugInfo *getDebugInfo() { return DebugInfo; } ASTContext &getContext() const { return Context; } const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; } -- cgit v1.2.3-18-g5258