Is there a way to print the IR (file) line number of a arbitrary llvm instruction? 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. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140327/a9b0c51b/attachment.html>
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.
Hi Tim, it worked perfectly. Thank you. On Friday, March 28, 2014 3:52 AM, Tim Northover <t.p.northover at gmail.com> wrote: 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140331/9136455d/attachment.html>