[LLVMdev] Source file information.

Devang Patel devang.patel at gmail.com
Thu Jul 9 09:50:09 PDT 2009


On Thu, Jul 9, 2009 at 5:41 AM, Aaron
Gray<aaronngray.lists at googlemail.com> wrote:
> Thanks for your reply. Is it not possible to do with llvm-g++ -g?
>
> Yes
>
> and furthermore, where are SDNode and DebugLoc fields stored?
>
> They are probably classes in the Clang API

Nope. SDNode is part of llvm code generator. DebugLoc is defined in a
stand alone llvm support header (see
llvm/include/llvm/Support/DebugLoc.h )

>
>  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 :-

Clang API is wrong answer here for Saman's needs.

>
>     http://clang.llvm.org/doxygen/classes.html
>     http://llvm.org/viewvc/llvm-project/cfe/trunk/
>
>  since, I am writing a pass for opt tool that manipulates the callgraph and
> want to get the line number information in runOnModule() function.

Saman, for now use findStopPoint() as suggested by John in the thread
for your needs. Just curious, why do your pass needs line number info
while manipulating call graph ?

-
Devang




More information about the llvm-dev mailing list