diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-21 21:27:42 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-21 21:27:42 +0000 |
commit | e0b691a25f801d8be552c9387863637b9526e639 (patch) | |
tree | 3c89a582b033ac76928dabf37dce5e5c966a9c3d /lib/CodeGen/CodeGenModule.h | |
parent | 45f9b7e8f23072d662ee1cc758f4ecb0da5e3322 (diff) |
In supporting init-priority, globals with the same init_priority must be
emitted in the order in which they are seen (still radar 8076356).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 0bb9d4ded9..713a5fdd64 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -75,6 +75,13 @@ namespace CodeGen { class CGObjCRuntime; class MangleBuffer; + typedef struct OrderGlobalInits{ + unsigned int priority; + unsigned int lex_order; + OrderGlobalInits(unsigned int p, unsigned int l) + : priority(p), lex_order(l) {} + } OrderGlobalInitsType; + /// CodeGenModule - This class organizes the cross-function state that is used /// while generating LLVM code. class CodeGenModule : public BlockModule { @@ -142,7 +149,8 @@ class CodeGenModule : public BlockModule { /// - Global variables with initializers whose order of initialization /// is set by init_priority attribute. - llvm::SmallVector<std::pair<unsigned int, llvm::Function*>, 8> + + llvm::SmallVector<std::pair<OrderGlobalInitsType, llvm::Function*>, 8> PrioritizedCXXGlobalInits; /// CXXGlobalDtors - Global destructor functions and arguments that need to |