[cfe-dev] Identify whether Stmt is member of a ForStmt / WhileStmt

Alex L arphaman at gmail.com
Tue Jul 22 09:17:31 PDT 2014


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<ForStmt>(S)) { }

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


2014-07-22 4:48 GMT-07:00 Greenwalker <panagos13 at hotmail.com>:

> Hi all,
>
> Given an Stmt is it possible to identify if it is member of one (or
> multiple) ForStmt / WhileStmt ?
>
> Thanks :)
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Identify-whether-Stmt-is-member-of-a-ForStmt-WhileStmt-tp4040690.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140722/8d011195/attachment.html>


More information about the cfe-dev mailing list