From b88a566cc10b241b226ff0d3ca0e2a831dcaa330 Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 30 Mar 2012 21:00:39 +0000 Subject: Make sure we unique static-local decls across multiple emissions of the function body, but do so in a way that doesn't make any assumptions about the static local actually having a proper, unique mangling, since apparently we don't do that correctly at all. llvm-svn: 153776 --- clang/lib/CodeGen/CodeGenModule.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 5719afb..38f5008 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -280,6 +280,7 @@ class CodeGenModule : public CodeGenTypeCache { llvm::StringMap CFConstantStringMap; llvm::StringMap ConstantStringMap; llvm::DenseMap StaticLocalDeclMap; + llvm::DenseMap StaticLocalDeclGuardMap; llvm::DenseMap AtomicSetterHelperFnMap; llvm::DenseMap AtomicGetterHelperFnMap; @@ -405,6 +406,14 @@ public: StaticLocalDeclMap[D] = C; } + llvm::GlobalVariable *getStaticLocalDeclGuardAddress(const VarDecl *D) { + return StaticLocalDeclGuardMap[D]; + } + void setStaticLocalDeclGuardAddress(const VarDecl *D, + llvm::GlobalVariable *C) { + StaticLocalDeclGuardMap[D] = C; + } + llvm::Constant *getAtomicSetterHelperFnMap(QualType Ty) { return AtomicSetterHelperFnMap[Ty]; } -- cgit v1.1