[llvm-commits] CVS: llvm/lib/Analysis/IntervalPartition.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 22 15:27:34 PST 2005
Changes in directory llvm/lib/Analysis:
IntervalPartition.cpp updated: 1.27 -> 1.28
---
Log message:
Remove use of bind_obj, deleter, and finegrainify namespacification.
---
Diffs of the changes: (+15 -18)
IntervalPartition.cpp | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
Index: llvm/lib/Analysis/IntervalPartition.cpp
diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.27 llvm/lib/Analysis/IntervalPartition.cpp:1.28
--- llvm/lib/Analysis/IntervalPartition.cpp:1.27 Mon Dec 6 22:03:45 2004
+++ llvm/lib/Analysis/IntervalPartition.cpp Tue Feb 22 17:27:21 2005
@@ -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 @@
// 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 @@
++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 @@
++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
More information about the llvm-commits
mailing list