[LLVMdev] The line number range of a function in source code level
liuml07 at gmail.com
Fri Apr 12 02:31:59 PDT 2013
I need to know the line number range of a function. The start of the
function line number can be found by the definition point, which is stored
at the subprogram metadata: DISubprogram::getLineNumber().
However, there is no API (or the metadata in the first place) to know the
end of the function.
I have to visit all the instructions of the function and maintain the
*max*line number of the instructions. I use the inst_begin(func):
inst_end(func) as the iterator. But I don't think it's effective to iterate
all the instructions from the beginning. It's supposed that we can iterate
the instructions reversely and the first one who has attached metadata
should be treated as the end of the function. Unfortunately, there is no
reverse iterator of a function.
Thank you very much!
Mingliang LIU (刘明亮 in Chinese)
PACMAN Group, Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: liuml07 at mails.tsinghua.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev