diff options
author | John McCall <rjmccall@apple.com> | 2010-07-15 23:40:35 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-15 23:40:35 +0000 |
commit | bf40cb518312dde1c07e44fcae59bc4eec65589c (patch) | |
tree | 8586ebdad129f9ce6f455050c230fda0570edb08 /lib/CodeGen/CodeGenModule.h | |
parent | 15a3d7df1ad667c6c09e34def34d546124c9efac (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 27f15fc018..05d02ec0a0 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/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. |