From e0b691a25f801d8be552c9387863637b9526e639 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 21 Jun 2010 21:27:42 +0000 Subject: 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 --- lib/CodeGen/CodeGenModule.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.h') 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, 8> + + llvm::SmallVector, 8> PrioritizedCXXGlobalInits; /// CXXGlobalDtors - Global destructor functions and arguments that need to -- cgit v1.2.3-70-g09d2