aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/Writer.cpp
blob: 48e8b5ac9dde3c38fb0255683fc2c105c3950323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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/Interval.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"));
}