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 | 89bdd14f2f89fd7486be5fb0fde62e00182aeb89 (patch) | |
tree | 83ba9de23d76457bbf7efd8ce44030e7444fdefc /clang/lib/CodeGen/CodeGenModule.h | |
parent | 72df24037e0f628c01c5f421ba32dfc260ec26be (diff) | |
download | bcm5719-llvm-89bdd14f2f89fd7486be5fb0fde62e00182aeb89.tar.gz bcm5719-llvm-89bdd14f2f89fd7486be5fb0fde62e00182aeb89.zip |
In supporting init-priority, globals with the same init_priority must be
emitted in the order in which they are seen (still radar 8076356).
llvm-svn: 106485
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 0bb9d4ded93..713a5fdd64a 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/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 |