diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-27 06:32:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-27 06:32:58 +0000 |
commit | ec2830d930e306124c2ba6bf1060a3c71dced6ea (patch) | |
tree | a02bab7303822e0c900f08890529da888461174a /lib/CodeGen/CodeGenModule.h | |
parent | 6d11cdbde41aa847369db85369b2ce5f82515b06 (diff) |
tidy up OrderGlobalInits
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 4fbf34319f..d0d3c7caee 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -75,26 +75,24 @@ namespace CodeGen { class CGObjCRuntime; class MangleBuffer; - typedef struct OrderGlobalInits{ + struct OrderGlobalInits { unsigned int priority; unsigned int lex_order; OrderGlobalInits(unsigned int p, unsigned int l) - : priority(p), lex_order(l) {} - friend bool operator==(const OrderGlobalInits &LHS, - const OrderGlobalInits &RHS) { - return LHS.priority == RHS.priority && - LHS.lex_order == RHS.lex_order; + : priority(p), lex_order(l) {} + + bool operator==(const OrderGlobalInits &RHS) const { + return priority == RHS.priority && + lex_order == RHS.lex_order; } - friend bool operator<(const OrderGlobalInits &LHS, - const OrderGlobalInits &RHS) { - if (LHS.priority < RHS.priority) + bool operator<(const OrderGlobalInits &RHS) const { + if (priority < RHS.priority) return true; - return LHS.priority == RHS.priority && - LHS.lex_order < RHS.lex_order; + return priority == RHS.priority && lex_order < RHS.lex_order; } - } OrderGlobalInitsType; + }; /// CodeGenModule - This class organizes the cross-function state that is used /// while generating LLVM code. @@ -168,7 +166,7 @@ class CodeGenModule : public BlockModule { /// - Global variables with initializers whose order of initialization /// is set by init_priority attribute. - llvm::SmallVector<std::pair<OrderGlobalInitsType, llvm::Function*>, 8> + llvm::SmallVector<std::pair<OrderGlobalInits, llvm::Function*>, 8> PrioritizedCXXGlobalInits; /// CXXGlobalDtors - Global destructor functions and arguments that need to |