mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
IntervalPartition was changed to inherit from vector<Interval*> instead of
contain it so that it would have full iterator access without much work. Writer includes code to print out IntervalPartition's now. llvm-svn: 133
This commit is contained in:
parent
223a2f8df5
commit
8939261a8b
@ -24,7 +24,7 @@ IntervalPartition::~IntervalPartition() {
|
||||
// interval itself (in the IntervalMap).
|
||||
//
|
||||
void IntervalPartition::addIntervalToPartition(Interval *I) {
|
||||
IntervalList.push_back(I);
|
||||
push_back(I);
|
||||
|
||||
// Add mappings for all of the basic blocks in I to the IntervalPartition
|
||||
for (Interval::node_iterator It = I->Nodes.begin(), End = I->Nodes.end();
|
||||
|
@ -6,11 +6,15 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/Analysis/Writer.h"
|
||||
#include "llvm/Analysis/Interval.h"
|
||||
#include "llvm/Analysis/IntervalPartition.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Interval Printing Routines
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void cfg::WriteToOutput(const Interval *I, ostream &o) {
|
||||
o << "-------------------------------------------------------------\n"
|
||||
<< "Interval Contents:\n";
|
||||
@ -28,6 +32,16 @@ void cfg::WriteToOutput(const Interval *I, ostream &o) {
|
||||
ostream_iterator<BasicBlock*>(o, "\n"));
|
||||
}
|
||||
|
||||
void cfg::WriteToOutput(const IntervalPartition &IP, ostream &o) {
|
||||
copy(IP.begin(), IP.end(), ostream_iterator<const Interval *>(o, "\n"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Dominator Printing Routines
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
ostream &operator<<(ostream &o, const set<const BasicBlock*> &BBs) {
|
||||
copy(BBs.begin(), BBs.end(), ostream_iterator<const BasicBlock*>(o, "\n"));
|
||||
return o;
|
||||
|
Loading…
Reference in New Issue
Block a user