48 class DomTreeGraph :
public PrintableGraph<Method*,BeginInst*> {
53 const DFSTraversal<BeginInst>
dfs;
57 DomTreeGraph(
const Method &
M, DominatorTree &
DT,
bool verbose =
false) :
59 for(Method::BBListTy::const_iterator
i = M.bb_begin(),
60 e = M.bb_end();
i !=
e; ++
i) {
65 BeginInst *idom = DT.get_idominator(BI);
67 EdgeType edge = std::make_pair(idom,BI);
73 virtual OStream& getGraphName(OStream&
OS)
const {
74 return OS <<
"DomTreeGraph";
77 virtual OStream& getNodeLabel(OStream&
OS, BeginInst *
const &node)
const {
98 std::string get_filename(
methodinfo *m,
jitdata *jd, std::string prefix =
"cfg_", std::string suffix=
".dot");
99 std::string get_filename(
methodinfo *m,
jitdata *jd, std::string prefix, std::string suffix)
101 std::string filename = prefix;
108 for (
size_t i = filename.find_first_of(
'/');
109 i != std::string::npos;
110 i = filename.find_first_of(
'/',
i+1)) {
111 filename.replace(
i,1,1,
'.');
113 const char *unchar =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.";
114 for (
size_t i = filename.find_first_not_of(unchar);
115 i != std::string::npos;
116 i = filename.find_first_not_of(unchar,
i+1)) {
117 filename.replace(
i,1,1,
'_');
virtual PassUsage & get_PassUsage(PassUsage &PU) const
Set the requirements for the pass.
static void print(const char *filename, const PrintableGraphTy &G)
const DFSTraversal< BeginInst > dfs
static Option< bool > enabled
JNIEnv jclass jobject const char * name
jitdata * get_jitdata() const
std::set< EdgeType > & edges
Stores the interdependencies of a pass.
virtual bool run(JITData &JD)
Run the Pass.
byte_iterator begin() const
static PassRegistry< BasicBlockSchedulingPass > X("BasicBlockSchedulingPass")
void add_requires()
PassName is required.
Calculate the Dominator Tree.