summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-03 15:28:35 +0000
committerChris Lattner <sabre@nondot.org>2001-07-03 15:28:35 +0000
commite6850235f55be2e90a6aa7624b46807d8a6fb7ac (patch)
tree388e1b02ee0f247790374fac661913cc01465230 /lib/Analysis
parenta49e015180bf85e1ffd934dbc94c0deda60873f6 (diff)
downloadllvm-e6850235f55be2e90a6aa7624b46807d8a6fb7ac.tar.gz
llvm-e6850235f55be2e90a6aa7624b46807d8a6fb7ac.tar.bz2
llvm-e6850235f55be2e90a6aa7624b46807d8a6fb7ac.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/IntervalPartition.cpp2
-rw-r--r--lib/Analysis/Writer.cpp16
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/Analysis/IntervalPartition.cpp b/lib/Analysis/IntervalPartition.cpp
index af6cea1627..bbdcbef65f 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 9080dc6144..6fce54a828 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 <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;