Code got moved from the lib/Assembly/Writer/IntervalWriter.cpp file to
here. Updates to correct description n stuff. llvm-svn: 129
This commit is contained in:
parent
a2bb73e41f
commit
fa3ac26d22
|
@ -1,12 +1,13 @@
|
||||||
//===-- IntervalWriter.cpp - Library for printing Intervals ------*- C++ -*--=//
|
//===-- Analysis/Writer.cpp - Printing routines for analyses -----*- C++ -*--=//
|
||||||
//
|
//
|
||||||
// This library implements the interval printing functionality defined in
|
// This library file implements analysis result printing support for
|
||||||
// llvm/Assembly/Writer.h
|
// llvm/Analysis/Writer.h
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Analysis/Writer.h"
|
||||||
#include "llvm/Analysis/Interval.h"
|
#include "llvm/Analysis/Interval.h"
|
||||||
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
@ -27,8 +28,6 @@ void cfg::WriteToOutput(const Interval *I, ostream &o) {
|
||||||
ostream_iterator<BasicBlock*>(o, "\n"));
|
ostream_iterator<BasicBlock*>(o, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "llvm/Analysis/Dominators.h"
|
|
||||||
|
|
||||||
ostream &operator<<(ostream &o, const set<const BasicBlock*> &BBs) {
|
ostream &operator<<(ostream &o, const set<const BasicBlock*> &BBs) {
|
||||||
copy(BBs.begin(), BBs.end(), ostream_iterator<const BasicBlock*>(o, "\n"));
|
copy(BBs.begin(), BBs.end(), ostream_iterator<const BasicBlock*>(o, "\n"));
|
||||||
return o;
|
return o;
|
||||||
|
@ -53,10 +52,26 @@ void cfg::WriteToOutput(const ImmediateDominators &ID, ostream &o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cfg::WriteToOutput(const DominatorTree &DT, ostream &o) {
|
static ostream &operator<<(ostream &o, const cfg::DominatorTree::Node *Node) {
|
||||||
|
return o << Node->getNode() << "\n------------------------------------------\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void PrintDomTree(const cfg::DominatorTree::Node *N, ostream &o,
|
||||||
|
unsigned Lev) {
|
||||||
|
o << "Level #" << Lev << ": " << N;
|
||||||
|
for (cfg::DominatorTree::Node::const_iterator I = N->begin(), E = N->end();
|
||||||
|
I != E; ++I) {
|
||||||
|
PrintDomTree(*I, o, Lev+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cfg::WriteToOutput(const DominatorTree &DT, ostream &o) {
|
||||||
|
o << "=============================--------------------------------\n"
|
||||||
|
<< "Inorder Dominator Tree:\n";
|
||||||
|
PrintDomTree(DT[DT.getRoot()], o, 1);
|
||||||
|
}
|
||||||
|
|
||||||
void cfg::WriteToOutput(const DominanceFrontier &DF, ostream &o) {
|
void cfg::WriteToOutput(const DominanceFrontier &DF, ostream &o) {
|
||||||
for (DominanceFrontier::const_iterator I = DF.begin(), E = DF.end();
|
for (DominanceFrontier::const_iterator I = DF.begin(), E = DF.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
|
|
Loading…
Reference in New Issue