[llvm-commits] [llvm] r52545 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp ScheduleDAG.cpp
Dan Gohman
gohman at apple.com
Fri Jun 20 10:15:19 PDT 2008
Author: djg
Date: Fri Jun 20 12:15:19 2008
New Revision: 52545
URL: http://llvm.org/viewvc/llvm-project?rev=52545&view=rev
Log:
Clean up some uses of std::distance, now that we have allnodes_size.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=52545&r1=52544&r2=52545&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jun 20 12:15:19 2008
@@ -313,8 +313,7 @@
}
assert(Order.size() == Visited.size() &&
- Order.size() ==
- (unsigned)std::distance(DAG.allnodes_begin(), DAG.allnodes_end()) &&
+ Order.size() == DAG.allnodes_size() &&
"Error: DAG is cyclic!");
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=52545&r1=52544&r2=52545&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Fri Jun 20 12:15:19 2008
@@ -97,7 +97,7 @@
// Reserve entries in the vector for each of the SUnits we are creating. This
// ensure that reallocation of the vector won't happen, so SUnit*'s won't get
// invalidated.
- SUnits.reserve(std::distance(DAG.allnodes_begin(), DAG.allnodes_end()));
+ SUnits.reserve(DAG.allnodes_size());
for (SelectionDAG::allnodes_iterator NI = DAG.allnodes_begin(),
E = DAG.allnodes_end(); NI != E; ++NI) {
@@ -105,7 +105,7 @@
continue;
// If this node has already been processed, stop now.
- if (SUnitMap[NI].size()) continue;
+ if (!SUnitMap[NI].empty()) continue;
SUnit *NodeSUnit = NewSUnit(NI);
More information about the llvm-commits
mailing list