aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-15 23:40:35 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-15 23:40:35 +0000
commit70013b640f175f5e6992e3193be3ae3c862416d6 (patch)
tree42a5e2f79975485b0b2bd1b3b5b2e5cd118890b5 /clang/lib/CodeGen/CodeGenModule.h
parentfbbdfcaea78dd354cad7bbf2d98de6d201307c69 (diff)
downloadllvm-70013b640f175f5e6992e3193be3ae3c862416d6.zip
llvm-70013b640f175f5e6992e3193be3ae3c862416d6.tar.gz
llvm-70013b640f175f5e6992e3193be3ae3c862416d6.tar.bz2
When deferring the emission of declarations with initializers in C++, remember
the order they appeared in the translation unit. If they get emitted, put them in their proper order. Fixes rdar://problem/7458115 llvm-svn: 108477
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 27f15fc..05d02ec 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -162,6 +162,12 @@ class CodeGenModule : public BlockModule {
/// CXXGlobalInits - Global variables with initializers that need to run
/// before main.
std::vector<llvm::Constant*> CXXGlobalInits;
+
+ /// When a C++ decl with an initializer is deferred, null is
+ /// appended to CXXGlobalInits, and the index of that null is placed
+ /// here so that the initializer will be performed in the correct
+ /// order.
+ llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
/// - Global variables with initializers whose order of initialization
/// is set by init_priority attribute.