Printing the CFG for a .ll file

Hello all,

Is there an existing tool/option to print a control flow graph for a llvm file into dot format?

Regards,

Charles Noble

Hi Charles,

Through clang:

  clang -mllvm -dot-cfg foo.c

Through opt:

  opt -dot-cfg foo.bc
  opt -dot-cfg foo.ll

You can dot various other things, check opt -help-hidden for the
"-dot-XXXX" options (or clang -mllvm -help-hidden I guess).

Cheers,
  Johannes