[cfe-dev] AST matcher for innermost and outermost loops

Piotr Padlewski via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 29 12:43:56 PDT 2016


There is not, but it is very easy to do one, the same way as you said:

forStmt(unless(hasDescendant(forStmt()))) and
forStmt(unless(hasAncestor(forStmt()))) should do the work

2016-08-29 12:33 GMT-07:00 alireza nazari via cfe-dev <
cfe-dev at lists.llvm.org>:

> Hi,
>
> Is there any way to use statement matcher that can directly result nodes
> which are innermost loops? Basically I want to add a piece of code inside
> the inner most loops and outside of the outermost loops(loops which have no
> forstmt descendent and loops which have no forstmt ancestor.) Is any
> StatementMatcher that can result any of them?
>
> Thank you,
> Alireza
>
> _______________________________________________
> 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/20160829/8fe6f044/attachment.html>


More information about the cfe-dev mailing list