llvm dumping control flow graph to file inside a pass -
i want build control flow graph diagram in llvm in 1 of passes. use following show cfg
block->getparent()->viewcfg(); //block basic block
the problem pops windows. want dump cfg @ particular program point, dot file (or jpg if possible), not show in window. how can same? using llvm 3.1.
note: modifying cfg in pass, before program point. hence cannot use opt -view-cfg
.
update:
thanks mishr, able draw graph this
writegraph(file, (const llvm::function*) &fun, true, "test"); //i have tired false
the cfg shown. nodes blank. how can show contents of node
take @ this, read comment before viewcfg()
function.
http://llvm.org/docs/doxygen/html/cfgprinter_8cpp_source.html
the viewcfg()
function intended printing cfg in new window. dump cfg in file have use cfgprinter
pass can invoked handle dot-cfg
.
Comments
Post a Comment