[LLVMdev] IR Line Number

Tim Northover t.p.northover at gmail.com
Thu Mar 27 23:52:50 PDT 2014


Hi,

> I'm debugging an analysis pass and it would help a lot if I could exactly
> identify which instruction I'm outputting information about on the screen.

Usually there's no concept of line number in the in-memory data
structures (.bc is equally valid input and doesn't have lines).

If you run the "debug-ir" pass before yours it'll add Dwarf info to
each instruction, which describes what you want. You can then access
it with Instruction::getDebugLoc.

Cheers.

Tim.



More information about the llvm-dev mailing list