mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 06:40:18 +00:00
Add printing code for dominator info
llvm-svn: 125
This commit is contained in:
parent
081aabc330
commit
a7f22e53c0
@ -26,3 +26,43 @@ void cfg::WriteToOutput(const Interval *I, ostream &o) {
|
|||||||
copy(I->Successors.begin(), I->Successors.end(),
|
copy(I->Successors.begin(), I->Successors.end(),
|
||||||
ostream_iterator<BasicBlock*>(o, "\n"));
|
ostream_iterator<BasicBlock*>(o, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "llvm/Analysis/Dominators.h"
|
||||||
|
|
||||||
|
ostream &operator<<(ostream &o, const set<const BasicBlock*> &BBs) {
|
||||||
|
copy(BBs.begin(), BBs.end(), ostream_iterator<const BasicBlock*>(o, "\n"));
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cfg::WriteToOutput(const DominatorSet &DS, ostream &o) {
|
||||||
|
for (DominatorSet::const_iterator I = DS.begin(), E = DS.end(); I != E; ++I) {
|
||||||
|
o << "=============================--------------------------------\n"
|
||||||
|
<< "\nDominator Set For Basic Block\n" << I->first
|
||||||
|
<< "-------------------------------\n" << I->second << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void cfg::WriteToOutput(const ImmediateDominators &ID, ostream &o) {
|
||||||
|
for (ImmediateDominators::const_iterator I = ID.begin(), E = ID.end();
|
||||||
|
I != E; ++I) {
|
||||||
|
o << "=============================--------------------------------\n"
|
||||||
|
<< "\nImmediate Dominator For Basic Block\n" << I->first
|
||||||
|
<< "is: \n" << I->second << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void cfg::WriteToOutput(const DominatorTree &DT, ostream &o) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void cfg::WriteToOutput(const DominanceFrontier &DF, ostream &o) {
|
||||||
|
for (DominanceFrontier::const_iterator I = DF.begin(), E = DF.end();
|
||||||
|
I != E; ++I) {
|
||||||
|
o << "=============================--------------------------------\n"
|
||||||
|
<< "\nDominance Frontier For Basic Block\n" << I->first
|
||||||
|
<< "is: \n" << I->second << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user