<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Hi all,</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><br class=""></div><div class="" 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 class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><div class="">if (MDNode *N = I->getMetadata("dbg")) {  // Here I is an LLVM instruction</div><div class="">  DILocation Loc(N);                      // DILocation is in DebugInfo.h</div><div class="">  unsigned Line = Loc.getLineNumber();</div><div class="">  StringRef File = Loc.getFilename();</div><div class="">  StringRef Dir = Loc.getDirectory();</div><div class="">}</div></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">As specified also at <a href="http://llvm.org/docs/SourceLevelDebugging.html" class="">http://llvm.org/docs/SourceLevelDebugging.html</a></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">However, looks like that the instruction " DILocation Loc(N);” is not valid anymore,</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Since the DILocation class is changed. </div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Is that right?</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">How can I extract debug info (line, filename, etc.) from an instruction?</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Thanks.</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Best Regards,</div><div class="" style="font-family: Calibri, sans-serif; font-size: 14px;">Simone</div><div apple-content-edited="true" class=""><br class="">

</div>
<br class=""></body></html>