[LLVMdev] Source file information.

Aaron Gray aaronngray.lists at googlemail.com
Thu Jul 9 05:41:06 PDT 2009

Thanks for your reply. Is it not possible to do with llvm-g++ -g?

and furthermore, where are SDNode and DebugLoc fields stored?

They are probably classes in the Clang API

 are they in a file which I have to parse myself? if so, is there any way that I use a library to get the file/line information for each instruction?

Yes Clang API :-


 since, I am writing a pass for opt tool that manipulates the callgraph and want to get the line number information in runOnModule() function.

Thats LLVM, as Edwin says "See Analysis/DebugInfo.h, and opt -print-dbginfo for an example of how
to use it."


Anyway theres some pointers,




  On Thu, Jul 9, 2009 at 8:13 AM, Saman Aliari Zonouz <saliari2 at uiuc.edu> wrote:


    I am new to LLVM, and need to find the line number and cpp source file name for each instruction in a .bc file. I suppose llvm debugger might have that feature but there is no documentation on it. Would you please give me some help how to do it?

    ::Saman Zonouz
    University of Illinois


  LLVM Developers mailing list
  LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090709/2516ce19/attachment.html>

More information about the llvm-dev mailing list