[LLVMdev] Printing DSGraph in llvm-3.0

Will Dietz willdtz at gmail.com
Sat Nov 5 22:50:16 PDT 2011


On Sun, Nov 6, 2011 at 12:24 AM, Ankita (Garg) Goel
<gargankita at gmail.com> wrote:
> Hi,
> I am using the DSA analysis in llvm-3.0. I am interested in seeing the
> resultant DSGraph for my sample input program. I tried the -dsa-only-print
> parameter, but was not successful in getting the .dot file for the graph as
> mentioned in Printer.cpp. The exact command that I tried is:
> #opt -load <path-to-llvmdatastructures.so> -dsa-local -dsa-bu -dsa-td
> -dsa-only-print < hello.bc
> Is there anything else I need to do to get the graph ? Thanks a lot for your
> help !
>

Hi!

Graph printing is actually done as part of the -analyze option, and by
default will print the globals graph as well as each function's graph.

If you're interested in only particular functions' graphs, use the
-dsa-only-print option (in addition to -analyze) to specify which
function(s) to limit printing to.  The globals graph is emitted at all
times regardless.

Hope this helps, and let me know if you have any further questions or issues :)

~Will



More information about the llvm-dev mailing list