summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-21 05:27:22 +0000
committerChris Lattner <sabre@nondot.org>2001-06-21 05:27:22 +0000
commitb20a15d3349b7745900c815e471b15d0cedfe339 (patch)
tree801d5f85f353c024e7aa011ddf904fe816e140a4 /llvm/lib/Analysis/Writer.cpp
parentd79faa35afaea7f00d624dfa3f38485efe1cb852 (diff)
downloadbcm5719-llvm-b20a15d3349b7745900c815e471b15d0cedfe339.tar.gz
bcm5719-llvm-b20a15d3349b7745900c815e471b15d0cedfe339.zip
Moved printing code to the Assembly/Writer library.
Code now detects looping intervals llvm-svn: 52
Diffstat (limited to 'llvm/lib/Analysis/Writer.cpp')
-rw-r--r--llvm/lib/Analysis/Writer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/Writer.cpp b/llvm/lib/Analysis/Writer.cpp
new file mode 100644
index 00000000000..3abe70a7dfb
--- /dev/null
+++ b/llvm/lib/Analysis/Writer.cpp
@@ -0,0 +1,28 @@
+//===-- IntervalWriter.cpp - Library for printing Intervals ------*- C++ -*--=//
+//
+// This library implements the interval printing functionality defined in
+// llvm/Assembly/Writer.h
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Assembly/Writer.h"
+#include "llvm/Analysis/Intervals.h"
+#include <iterator>
+#include <algorithm>
+
+void cfg::WriteToOutput(const Interval *I, ostream &o) {
+ o << "-------------------------------------------------------------\n"
+ << "Interval Contents:\n";
+
+ // Print out all of the basic blocks in the interval...
+ copy(I->Nodes.begin(), I->Nodes.end(),
+ ostream_iterator<BasicBlock*>(o, "\n"));
+
+ o << "Interval Predecessors:\n";
+ copy(I->Predecessors.begin(), I->Predecessors.end(),
+ ostream_iterator<BasicBlock*>(o, "\n"));
+
+ o << "Interval Successors:\n";
+ copy(I->Successors.begin(), I->Successors.end(),
+ ostream_iterator<BasicBlock*>(o, "\n"));
+}
OpenPOWER on IntegriCloud