[cfe-dev] Get the corresponding program statement from line number of a source file

Riyad Parvez riyad.parvez at gmail.com
Mon May 11 17:43:22 PDT 2015


I've the line number of a source file and I want to get the 
corresponding "Stmt" object. There may be more than one program 
statement in a source line, but in my use case, it's guaranteed to be 
one program statement in the given source line from the user.

A brute force way can be iterating over all the statements and trying to 
match the source line number. But I'm just wondering is there a nicer 
and more efficient way to do this.


More information about the cfe-dev mailing list