diff options
| author | Dan Gohman <gohman@apple.com> | 2008-06-20 17:15:19 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-06-20 17:15:19 +0000 |
| commit | 3792c470d52e3d2bf21111324ab7a9d7743cf6d9 (patch) | |
| tree | d05b791b6323c360dc7214b6922283f1cf2d902a /llvm/lib/CodeGen | |
| parent | 3ada1e118b207ff7e9df055ec7a120047b1917e9 (diff) | |
| download | bcm5719-llvm-3792c470d52e3d2bf21111324ab7a9d7743cf6d9.tar.gz bcm5719-llvm-3792c470d52e3d2bf21111324ab7a9d7743cf6d9.zip | |
Clean up some uses of std::distance, now that we have allnodes_size.
llvm-svn: 52545
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 883ba38ca34..3be33770bc8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -313,8 +313,7 @@ static void ComputeTopDownOrdering(SelectionDAG &DAG, } 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!"); } diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index d60d2b02ef0..d3cc11693e4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -97,7 +97,7 @@ void ScheduleDAG::BuildSchedUnits() { // 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 @@ void ScheduleDAG::BuildSchedUnits() { continue; // If this node has already been processed, stop now. - if (SUnitMap[NI].size()) continue; + if (!SUnitMap[NI].empty()) continue; SUnit *NodeSUnit = NewSUnit(NI); |

