<div dir="ltr">+Duncan because I don't remember exactly how things shifted</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 8:58 AM, Simone Atzeni via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="font-family:Calibri,sans-serif;font-size:14px">Hi all,</div><div style="font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="font-family:Calibri,sans-serif;font-size:14px">I used to extract the debug information from an LLVM Instruction in the following way:</div><div style="font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="font-family:Calibri,sans-serif;font-size:14px"><div>if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM instruction</div><div> DILocation Loc(N); // DILocation is in DebugInfo.h</div><div> unsigned Line = Loc.getLineNumber();</div><div> StringRef File = Loc.getFilename();</div><div> StringRef Dir = Loc.getDirectory();</div><div>}</div></div><div style="font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="font-family:Calibri,sans-serif;font-size:14px">As specified also at <a href="http://llvm.org/docs/SourceLevelDebugging.html" target="_blank">http://llvm.org/docs/SourceLevelDebugging.html</a></div><div style="font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="font-family:Calibri,sans-serif;font-size:14px">However, looks like that the instruction " DILocation Loc(N);” is not valid anymore,</div><div style="font-family:Calibri,sans-serif;font-size:14px">Since the DILocation class is changed. </div><div style="font-family:Calibri,sans-serif;font-size:14px">Is that right?</div><div style="font-family:Calibri,sans-serif;font-size:14px">How can I extract debug info (line, filename, etc.) from an instruction?</div><div style="font-family:Calibri,sans-serif;font-size:14px"><br></div><div style="font-family:Calibri,sans-serif;font-size:14px">Thanks.</div><div style="font-family:Calibri,sans-serif;font-size:14px">Best Regards,</div><div style="font-family:Calibri,sans-serif;font-size:14px">Simone</div><div><br>
</div>
<br></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>