CodeQL library for C/C++
codeql/cpp-all 0.4.0-dev (changelog, source)

Member predicate BlockStmt::getIndexOfStmt

Gets the index of the given statement within this block, indexed from 0.

For example, for the block

{ int a; int b = 1; a = b; }

if s is the expression statement a = b then getIndexOfStmt(s) has result 2.

int getIndexOfStmt(Stmt s)