[LLVMdev] Getting Basic block's scope information

Ryan ryan.deadbeef at gmail.com
Mon Jul 2 15:09:16 PDT 2012


Hi,
I'm trying to get all the basic blocks' scope{starting and ending line}
information inside a function.
Seems there's no metadata node attached to basic block. So what I did is
to get the first instruction and the terminator instruction of the BB, and
then
call getDebugLoc to get the line number. But the resulting ranges are not
very accurate.
Similarly I want to get the ending scope line information of a function
instead of just the definition line number.

I wonder if there's better way to implement this?
For example, is it possible to somehow get a DILexicalBlock instance from a
BasicBlock?

Thanks,
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120702/121017a3/attachment.html>


More information about the llvm-dev mailing list