// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
// nodes following it.
//
-class IntervalPartition {
+class IntervalPartition : public vector<Interval*> {
typedef map<BasicBlock*, Interval*> IntervalMapTy;
IntervalMapTy IntervalMap;
typedef vector<Interval*> IntervalListTy;
- IntervalListTy IntervalList;
Interval *RootInterval;
-public:
- typedef IntervalListTy::iterator iterator;
-
public:
// IntervalPartition ctor - Build the partition for the specified method
IntervalPartition(Method *M);
return I != IntervalMap.end() ? I->second : 0;
}
- // Iterators to iterate over all of the intervals in the method
- inline iterator begin() { return IntervalList.begin(); }
- inline iterator end() { return IntervalList.end(); }
- inline unsigned size() { return IntervalList.size(); }
-
private:
// addIntervalToPartition - Add an interval to the internal list of intervals,
// and then add mappings from all of the basic blocks in the interval to the
// This library provides support for printing out Intervals.
class Interval;
+ class IntervalPartition;
+
void WriteToOutput(const Interval *I, ostream &o);
inline ostream &operator <<(ostream &o, const Interval *I) {
WriteToOutput(I, o); return o;
}
+ void WriteToOutput(const IntervalPartition &IP, ostream &o);
+ inline ostream &operator <<(ostream &o, const IntervalPartition &IP) {
+ WriteToOutput(IP, o); return o;
+ }
+
// Stuff for printing out Dominator data structures...
class DominatorSet;
class ImmediateDominators;