mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-21 21:41:43 +00:00
IntervalPartition was changed to inherit from vector<Interval*> instead of
contain it so that it would have full iterator access without much work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3ea734986e
commit
a49e015180
@ -31,17 +31,13 @@ namespace cfg {
|
|||||||
// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
|
// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
|
||||||
// nodes following it.
|
// nodes following it.
|
||||||
//
|
//
|
||||||
class IntervalPartition {
|
class IntervalPartition : public vector<Interval*> {
|
||||||
typedef map<BasicBlock*, Interval*> IntervalMapTy;
|
typedef map<BasicBlock*, Interval*> IntervalMapTy;
|
||||||
IntervalMapTy IntervalMap;
|
IntervalMapTy IntervalMap;
|
||||||
|
|
||||||
typedef vector<Interval*> IntervalListTy;
|
typedef vector<Interval*> IntervalListTy;
|
||||||
IntervalListTy IntervalList;
|
|
||||||
Interval *RootInterval;
|
Interval *RootInterval;
|
||||||
|
|
||||||
public:
|
|
||||||
typedef IntervalListTy::iterator iterator;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// IntervalPartition ctor - Build the partition for the specified method
|
// IntervalPartition ctor - Build the partition for the specified method
|
||||||
IntervalPartition(Method *M);
|
IntervalPartition(Method *M);
|
||||||
@ -71,11 +67,6 @@ public:
|
|||||||
return I != IntervalMap.end() ? I->second : 0;
|
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:
|
private:
|
||||||
// addIntervalToPartition - Add an interval to the internal list of intervals,
|
// 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
|
// and then add mappings from all of the basic blocks in the interval to the
|
||||||
|
@ -14,11 +14,18 @@ namespace cfg {
|
|||||||
|
|
||||||
// This library provides support for printing out Intervals.
|
// This library provides support for printing out Intervals.
|
||||||
class Interval;
|
class Interval;
|
||||||
|
class IntervalPartition;
|
||||||
|
|
||||||
void WriteToOutput(const Interval *I, ostream &o);
|
void WriteToOutput(const Interval *I, ostream &o);
|
||||||
inline ostream &operator <<(ostream &o, const Interval *I) {
|
inline ostream &operator <<(ostream &o, const Interval *I) {
|
||||||
WriteToOutput(I, o); return o;
|
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...
|
// Stuff for printing out Dominator data structures...
|
||||||
class DominatorSet;
|
class DominatorSet;
|
||||||
class ImmediateDominators;
|
class ImmediateDominators;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user