Identify whether Stmt is member of a ForStmt / WhileStmt

Hi all,

Given an Stmt is it possible to identify if it is member of one (or
multiple) ForStmt / WhileStmt ?

Thanks :slight_smile:

Hi,

You can use the isa<> operator to check if the pointer to a statement is an instance of a specified class. For example:

if (isa(S)) { }

Take a look at http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates for more info.

Alex