[LLVMdev] line number of loop header

Duncan Sands baldrick at free.fr
Mon Apr 25 00:34:50 PDT 2011


Hi Bob,

> How can I get the line number in the .c or .cpp file for the loop header?
>
> For example, in the following loop:
>
> for(int i=0; i<  n; i++) {
>     a += 1;
> }
>
> I'd like to now the line number of the for(...) line.

at the LLVM level you need to use debug info, see
   http://llvm.org/docs/SourceLevelDebugging.html

Ciao, Duncan.



More information about the llvm-dev mailing list