Printing DSGraph in llvm-3.0

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 :slight_smile:

~Will

Hi Will,

Thanks a lot for the quick response. I was able to get the DSGraph. Guess I was missing the -analyze option.

Regards,
Ankita