summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Interval.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-27 01:12:17 +0000
committerChris Lattner <sabre@nondot.org>2002-07-27 01:12:17 +0000
commit2675007573b820d1c084afe560105ab8a622d942 (patch)
treef1d936ba7cfe6eff56304634bbc16e760d71837c /llvm/lib/Analysis/Interval.cpp
parent96a0dfa33e8469ef18866d1d89708af18929e38e (diff)
downloadbcm5719-llvm-2675007573b820d1c084afe560105ab8a622d942.tar.gz
bcm5719-llvm-2675007573b820d1c084afe560105ab8a622d942.zip
* Standardize how analysis results/passes as printed with the print() virtual
methods * Eliminate AnalysisID: Now it is just a typedef for const PassInfo* * Simplify how AnalysisID's are initialized * Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into the analyses themselves. llvm-svn: 3116
Diffstat (limited to 'llvm/lib/Analysis/Interval.cpp')
-rw-r--r--llvm/lib/Analysis/Interval.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/Interval.cpp b/llvm/lib/Analysis/Interval.cpp
index a4aa88abdbc..8ba8980a47e 100644
--- a/llvm/lib/Analysis/Interval.cpp
+++ b/llvm/lib/Analysis/Interval.cpp
@@ -8,6 +8,7 @@
#include "llvm/Analysis/Interval.h"
#include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h"
+#include <algorithm>
//===----------------------------------------------------------------------===//
// Interval Implementation
@@ -26,3 +27,19 @@ bool Interval::isLoop() const {
}
+void Interval::print(ostream &o) const {
+ o << "-------------------------------------------------------------\n"
+ << "Interval Contents:\n";
+
+ // Print out all of the basic blocks in the interval...
+ std::copy(Nodes.begin(), Nodes.end(),
+ std::ostream_iterator<BasicBlock*>(o, "\n"));
+
+ o << "Interval Predecessors:\n";
+ std::copy(Predecessors.begin(), Predecessors.end(),
+ std::ostream_iterator<BasicBlock*>(o, "\n"));
+
+ o << "Interval Successors:\n";
+ std::copy(Successors.begin(), Successors.end(),
+ std::ostream_iterator<BasicBlock*>(o, "\n"));
+}
OpenPOWER on IntegriCloud