From ec2830d930e306124c2ba6bf1060a3c71dced6ea Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 27 Jun 2010 06:32:58 +0000 Subject: tidy up OrderGlobalInits git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106976 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.h') 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, 8> + llvm::SmallVector, 8> PrioritizedCXXGlobalInits; /// CXXGlobalDtors - Global destructor functions and arguments that need to -- cgit v1.2.3-18-g5258