Remove use of bind_obj, deleter, and finegrainify namespacification.

llvm-svn: 20277
This commit is contained in:
Chris Lattner 2005-02-22 23:27:21 +00:00
parent 52e931b37d
commit 3166471603
1 changed files with 15 additions and 18 deletions

View File

@ -13,10 +13,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Analysis/IntervalIterator.h" #include "llvm/Analysis/IntervalIterator.h"
#include "llvm/ADT/STLExtras.h" using namespace llvm;
#include <algorithm>
namespace llvm {
static RegisterAnalysis<IntervalPartition> static RegisterAnalysis<IntervalPartition>
X("intervals", "Interval Partition Construction", true); 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 // destroy - Reset state back to before function was analyzed
void IntervalPartition::destroy() { 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(); IntervalMap.clear();
RootInterval = 0; RootInterval = 0;
} }
@ -74,14 +72,14 @@ bool IntervalPartition::runOnFunction(Function &F) {
++I; // After the first one... ++I; // After the first one...
// Add the rest of the intervals to the partition... // Add the rest of the intervals to the partition.
for_each(I, intervals_end(&F), for (function_interval_iterator E = intervals_end(&F); I != E; ++I)
bind_obj(this, &IntervalPartition::addIntervalToPartition)); addIntervalToPartition(*I);
// Now that we know all of the successor information, propagate this to the // Now that we know all of the successor information, propagate this to the
// predecessors for each block... // predecessors for each block.
for_each(Intervals.begin(), Intervals.end(), for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
bind_obj(this, &IntervalPartition::updatePredecessors)); updatePredecessors(Intervals[i]);
return false; return false;
} }
@ -102,14 +100,13 @@ IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) {
++I; // After the first one... ++I; // After the first one...
// Add the rest of the intervals to the partition... // Add the rest of the intervals to the partition.
for_each(I, intervals_end(IP), for (interval_part_interval_iterator E = intervals_end(IP); I != E; ++I)
bind_obj(this, &IntervalPartition::addIntervalToPartition)); addIntervalToPartition(*I);
// Now that we know all of the successor information, propagate this to the // Now that we know all of the successor information, propagate this to the
// predecessors for each block... // predecessors for each block.
for_each(Intervals.begin(), Intervals.end(), for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
bind_obj(this, &IntervalPartition::updatePredecessors)); updatePredecessors(Intervals[i]);
} }
} // End llvm namespace