From 8939261a8b935158651fc53936a7b04a2cb4d676 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 3 Jul 2001 15:28:35 +0000 Subject: [PATCH] IntervalPartition was changed to inherit from vector 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 --- lib/Analysis/IntervalPartition.cpp | 2 +- lib/Analysis/Writer.cpp | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/IntervalPartition.cpp b/lib/Analysis/IntervalPartition.cpp index af6cea1627d..bbdcbef65f4 100644 --- a/lib/Analysis/IntervalPartition.cpp +++ b/lib/Analysis/IntervalPartition.cpp @@ -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(); diff --git a/lib/Analysis/Writer.cpp b/lib/Analysis/Writer.cpp index 9080dc61441..6fce54a8288 100644 --- a/lib/Analysis/Writer.cpp +++ b/lib/Analysis/Writer.cpp @@ -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 #include +//===----------------------------------------------------------------------===// +// 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(o, "\n")); } +void cfg::WriteToOutput(const IntervalPartition &IP, ostream &o) { + copy(IP.begin(), IP.end(), ostream_iterator(o, "\n")); +} + + + +//===----------------------------------------------------------------------===// +// Dominator Printing Routines +//===----------------------------------------------------------------------===// + ostream &operator<<(ostream &o, const set &BBs) { copy(BBs.begin(), BBs.end(), ostream_iterator(o, "\n")); return o;