mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Move dominator info printer into tool/opt/GraphPrinters.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52907 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -287,33 +287,3 @@ void DominanceFrontierBase::dump() {
|
|||||||
print (llvm::cerr);
|
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);
|
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Value.h"
|
#include "llvm/Value.h"
|
||||||
#include "llvm/Analysis/CallGraph.h"
|
#include "llvm/Analysis/CallGraph.h"
|
||||||
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@@ -81,3 +82,34 @@ namespace {
|
|||||||
RegisterPass<CallGraphPrinter> P2("print-callgraph",
|
RegisterPass<CallGraphPrinter> P2("print-callgraph",
|
||||||
"Print Call Graph to 'dot' file");
|
"Print Call Graph to 'dot' file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// DomInfoPrinter Pass
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
class 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);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user