I'd like to hack into the standard passes when using the command line option -std-compile-opts. What I'd like to do is to stop after each pass and see the current program representation before the next pass is run in gdb. What is the favorite way to do this? Lu
On Apr 13, 2008, at 8:06 PM, Lu Zhao wrote:> I'd like to hack into the standard passes when using the command line > option -std-compile-opts. What I'd like to do is to stop after each > pass and see the current program representation before the next pass > is > run in gdb. What is the favorite way to do this? >If you're in GDB, then use something like this: M->dump() where M is the current Module. You can execute the same call with Function, BasicBlock, etc. If you're running opt on the command line directly, then use the "-p" option. See "-help" for more information on that. -bw
> If you're running opt on the command line directly, then use the > "-p" option. See "-help" for more information on that. > > -bw >I have a couple of more questions. 1. Does -std-compile-opts of opt do the same optimization with llvm-gcc with -O[1-3] options? If I want to debug into passes through llvm-gcc, how do I set a breakpoint right before pass execution? In my gdb llvm-gcc session, I don't have llvm::PassManager available. 2. When I use "-p" with opt, there is nothing I can see from the output. Instead, "--debug-pass=Details" gives me more detailed info. Did I miss other stuffs that are required to be with "-p?" Thanks. Lu