diff options
author | Chris Lattner <sabre@nondot.org> | 2005-02-22 23:27:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-02-22 23:27:21 +0000 |
commit | 3166471603f29b8d75aedc024be5fc81af75d70b (patch) | |
tree | 0176b0d09be82adf8f15e2c341fdbb360ba950fd /llvm/lib/Analysis/IntervalPartition.cpp | |
parent | 52e931b37d89b937783dd670736817f668dd08a2 (diff) | |
download | bcm5719-llvm-3166471603f29b8d75aedc024be5fc81af75d70b.tar.gz bcm5719-llvm-3166471603f29b8d75aedc024be5fc81af75d70b.zip |
Remove use of bind_obj, deleter, and finegrainify namespacification.
llvm-svn: 20277
Diffstat (limited to 'llvm/lib/Analysis/IntervalPartition.cpp')
-rw-r--r-- | llvm/lib/Analysis/IntervalPartition.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/llvm/lib/Analysis/IntervalPartition.cpp b/llvm/lib/Analysis/IntervalPartition.cpp index eb2c06cc64c..dd06501de9a 100644 --- a/llvm/lib/Analysis/IntervalPartition.cpp +++ b/llvm/lib/Analysis/IntervalPartition.cpp @@ -13,10 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/IntervalIterator.h" -#include "llvm/ADT/STLExtras.h" -#include <algorithm> - -namespace llvm { +using namespace llvm; static RegisterAnalysis<IntervalPartition> X("intervals", "Interval Partition Construction", true); @@ -27,7 +24,8 @@ X("intervals", "Interval Partition Construction", true); // destroy - Reset state back to before function was analyzed void IntervalPartition::destroy() { - std::for_each(Intervals.begin(), Intervals.end(), deleter<Interval>); + for (unsigned i = 0, e = Intervals.size(); i != e; ++i) + delete Intervals[i]; IntervalMap.clear(); RootInterval = 0; } @@ -74,14 +72,14 @@ bool IntervalPartition::runOnFunction(Function &F) { ++I; // After the first one... - // Add the rest of the intervals to the partition... - for_each(I, intervals_end(&F), - bind_obj(this, &IntervalPartition::addIntervalToPartition)); + // Add the rest of the intervals to the partition. + for (function_interval_iterator E = intervals_end(&F); I != E; ++I) + addIntervalToPartition(*I); // Now that we know all of the successor information, propagate this to the - // predecessors for each block... - for_each(Intervals.begin(), Intervals.end(), - bind_obj(this, &IntervalPartition::updatePredecessors)); + // predecessors for each block. + for (unsigned i = 0, e = Intervals.size(); i != e; ++i) + updatePredecessors(Intervals[i]); return false; } @@ -102,14 +100,13 @@ IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) { ++I; // After the first one... - // Add the rest of the intervals to the partition... - for_each(I, intervals_end(IP), - bind_obj(this, &IntervalPartition::addIntervalToPartition)); + // Add the rest of the intervals to the partition. + for (interval_part_interval_iterator E = intervals_end(IP); I != E; ++I) + addIntervalToPartition(*I); // Now that we know all of the successor information, propagate this to the - // predecessors for each block... - for_each(Intervals.begin(), Intervals.end(), - bind_obj(this, &IntervalPartition::updatePredecessors)); + // predecessors for each block. + for (unsigned i = 0, e = Intervals.size(); i != e; ++i) + updatePredecessors(Intervals[i]); } -} // End llvm namespace |