mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-27 05:55:40 +00:00
Add dominator info printer pass.
llvm-svn: 52829
This commit is contained in:
parent
eb63554d81
commit
d5faa747e9
@ -286,3 +286,34 @@ void DominanceFrontierBase::print(std::ostream &o, const Module* ) const {
|
||||
void DominanceFrontierBase::dump() {
|
||||
print (llvm::cerr);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// DomInfoPrinter Pass
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
namespace {
|
||||
class VISIBILITY_HIDDEN DomInfoPrinter : public FunctionPass {
|
||||
public:
|
||||
static char ID; // Pass identification, replacement for typeid
|
||||
DomInfoPrinter() : FunctionPass((intptr_t)&ID) {}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
AU.addRequired<DominatorTree>();
|
||||
AU.addRequired<DominanceFrontier>();
|
||||
|
||||
}
|
||||
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
DominatorTree &DT = getAnalysis<DominatorTree>();
|
||||
DT.dump();
|
||||
DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
|
||||
DF.dump();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
char DomInfoPrinter::ID = 0;
|
||||
static RegisterPass<DomInfoPrinter>
|
||||
DIP("print-dom-info", "Dominator Info Printer", true, true);
|
||||
|
Loading…
Reference in New Issue
Block a user