[llvm-dev] [LLVMdev] DebugInfo from LLVM Instruction

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 6 10:58:54 PDT 2015


+Duncan because I don't remember exactly how things shifted

On Thu, Aug 6, 2015 at 8:58 AM, Simone Atzeni via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all,
>
> I used to extract the debug information from an LLVM Instruction in the
> following way:
>
> if (MDNode *N = I->getMetadata("dbg")) {  // Here I is an LLVM instruction
>   DILocation Loc(N);                      // DILocation is in DebugInfo.h
>   unsigned Line = Loc.getLineNumber();
>   StringRef File = Loc.getFilename();
>   StringRef Dir = Loc.getDirectory();
> }
>
> As specified also at http://llvm.org/docs/SourceLevelDebugging.html
>
> However, looks like that the instruction " DILocation Loc(N);” is not
> valid anymore,
> Since the DILocation class is changed.
> Is that right?
> How can I extract debug info (line, filename, etc.) from an instruction?
>
> Thanks.
> Best Regards,
> Simone
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org         http://llvm.cs.uiuc.edu
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150806/a0acac9b/attachment-0001.html>


More information about the llvm-dev mailing list