[LLVMdev] How to view CFG of loop (not complete function)

Ivan Llopard ivanllopard at gmail.com
Fri Jul 20 07:52:30 PDT 2012


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



More information about the llvm-dev mailing list