aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-03-30 21:00:39 +0000
committerJohn McCall <rjmccall@apple.com>2012-03-30 21:00:39 +0000
commitb88a566cc10b241b226ff0d3ca0e2a831dcaa330 (patch)
tree141a26e1a36e53c0fe125e3818ac98fab21146f3 /clang/lib/CodeGen/CodeGenModule.h
parent191a6a86ad74f10b27250fb62483326f4b22c394 (diff)
downloadllvm-b88a566cc10b241b226ff0d3ca0e2a831dcaa330.zip
llvm-b88a566cc10b241b226ff0d3ca0e2a831dcaa330.tar.gz
llvm-b88a566cc10b241b226ff0d3ca0e2a831dcaa330.tar.bz2
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h9
1 files changed, 9 insertions, 0 deletions
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<llvm::Constant*> CFConstantStringMap;
llvm::StringMap<llvm::GlobalVariable*> ConstantStringMap;
llvm::DenseMap<const Decl*, llvm::Constant *> StaticLocalDeclMap;
+ llvm::DenseMap<const Decl*, llvm::GlobalVariable*> StaticLocalDeclGuardMap;
llvm::DenseMap<QualType, llvm::Constant *> AtomicSetterHelperFnMap;
llvm::DenseMap<QualType, llvm::Constant *> 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];
}