Chris Lattner | da95680 | 2001-06-21 05:27:22 +0000 | [diff] [blame^] | 1 | //===-- IntervalWriter.cpp - Library for printing Intervals ------*- C++ -*--=// |
| 2 | // |
| 3 | // This library implements the interval printing functionality defined in |
| 4 | // llvm/Assembly/Writer.h |
| 5 | // |
| 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #include "llvm/Assembly/Writer.h" |
| 9 | #include "llvm/Analysis/Intervals.h" |
| 10 | #include <iterator> |
| 11 | #include <algorithm> |
| 12 | |
| 13 | void cfg::WriteToOutput(const Interval *I, ostream &o) { |
| 14 | o << "-------------------------------------------------------------\n" |
| 15 | << "Interval Contents:\n"; |
| 16 | |
| 17 | // Print out all of the basic blocks in the interval... |
| 18 | copy(I->Nodes.begin(), I->Nodes.end(), |
| 19 | ostream_iterator<BasicBlock*>(o, "\n")); |
| 20 | |
| 21 | o << "Interval Predecessors:\n"; |
| 22 | copy(I->Predecessors.begin(), I->Predecessors.end(), |
| 23 | ostream_iterator<BasicBlock*>(o, "\n")); |
| 24 | |
| 25 | o << "Interval Successors:\n"; |
| 26 | copy(I->Successors.begin(), I->Successors.end(), |
| 27 | ostream_iterator<BasicBlock*>(o, "\n")); |
| 28 | } |