[cfe-commits] r106976 - in /cfe/trunk/lib/CodeGen: CGDeclCXX.cpp CodeGenModule.h
Chris Lattner
sabre at nondot.org
Sat Jun 26 23:32:59 PDT 2010
Author: lattner
Date: Sun Jun 27 01:32:58 2010
New Revision: 106976
URL: http://llvm.org/viewvc/llvm-project?rev=106976&view=rev
Log:
tidy up OrderGlobalInits
Modified:
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.h
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=106976&r1=106975&r2=106976&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Sun Jun 27 01:32:58 2010
@@ -173,7 +173,7 @@
if (D->hasAttr<InitPriorityAttr>()) {
unsigned int order = D->getAttr<InitPriorityAttr>()->getPriority();
- OrderGlobalInitsType Key(order, PrioritizedCXXGlobalInits.size());
+ OrderGlobalInits Key(order, PrioritizedCXXGlobalInits.size());
PrioritizedCXXGlobalInits.push_back(std::make_pair(Key, Fn));
}
else
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=106976&r1=106975&r2=106976&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Sun Jun 27 01:32:58 2010
@@ -75,26 +75,24 @@
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 @@
/// - 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
More information about the cfe-commits
mailing list