Martin Apel
2012-Jul-20 10:10 UTC
[LLVMdev] How to view CFG of loop (not complete function)
Hi all, I need to look at the CFG of a loop during debugging. However the containing function is very large, so it is rather difficult to use the CFG of the complete function. I tried using the ViewGraph method, but the compiler kept complaining about undefined symbols related to GraphTraits or DOTGraphTraits. Is there any example that I could look at to find out, what exactly I need to call something like ViewGraph(loop, "CFG") ? Martin
Ivan Llopard
2012-Jul-20 14:52 UTC
[LLVMdev] How to view CFG of loop (not complete function)
Hi Martin, GraphTraits and DOTGraphTraits are specialized so GraphWriter can print the CFG. Same holds for SelectionDAG and other graph-like structures in llvm. AFAIK, the GraphWriter doesn't have the ability to stream a range of BB's if that's what you are looking for. I think you will need to hack a little bit the GraphWriter in order to print a range of nodes instead of the entire graph, or create a custom one. Ivan On 20/07/2012 12:10, Martin Apel wrote:> Hi all, > > I need to look at the CFG of a loop during debugging. However the > containing function is very large, so it is rather difficult to use the > CFG of the complete function. I tried using the ViewGraph method, but > the compiler kept complaining about undefined symbols related to > GraphTraits or > DOTGraphTraits. Is there any example that I could look at to find out, > what exactly I need to call something like > ViewGraph(loop, "CFG") ? > > Martin > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev