mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Add dominator info printer pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b2931f29f3
commit
42af887105
@ -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