[llvm-dev] how to get source code location information in LLVM3.7.0?

Dylan McKay via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 27 19:41:56 PDT 2015


Example:

Module &M = /* .. */
Instruction &Inst = /* . */
const DebugLoc &DL = Inst.getDebugLoc();

StringRef file = M.getName();unsigned Line = DL.getLine();unsigned Col
= DL.getCol();

DebugLoc <http://llvm.org/docs/doxygen/html/classllvm_1_1DebugLoc.html>
documentation.
Module <http://llvm.org/docs/doxygen/html/classllvm_1_1Module.html>
documentation.
​

On Wed, Oct 28, 2015 at 3:24 PM, Q Z via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> could anyone give me some examples to get a instruction's line and
> filename information in source codes in LLVM3.7.0?
>
> thank you!
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> 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/20151028/f404ac75/attachment.html>


More information about the llvm-dev mailing list