[LLVMdev] source line number for instruction
Guoliang Jin
jingl1345 at gmail.com
Tue Jul 6 22:44:32 PDT 2010
Hi,
I found the following at
http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend:
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();
}
Does this also work for release 2.7? I did not see the same thing at the
documentation for release 2.7.
Thanks,
Guoliang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100707/944903db/attachment.html>
More information about the llvm-dev
mailing list