[cfe-dev] Finding Stmt Kind
Alexey Sidorin via cfe-dev
cfe-dev at lists.llvm.org
Sun Nov 18 10:23:02 PST 2018
Hi Pardis,
Take a look at Stmt::getStmtClass().
18.11.2018 21:20, Pardis Pashakhanloo via cfe-dev пишет:
> Hi all,
>
> Is it possible to get the kind of a Stmt object in clang?
> The only solution that I know of is using dyn_cast. However, in this
> solution, I have to check for every kind of Stmt, e.g.
> if (CompoundStmt *CS = dyn_cast<CompoundStmt>(d))
> ....
> else if (IfStmt *IS = dyn_cast<IfStmt>(d))
> ....
>
> Is there a better solution or trick?
>
> Thanks,
> Pardis
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181118/0ddf4e1c/attachment.html>
More information about the cfe-dev
mailing list