[cfe-dev] match OffsetOfExpr

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Fri Aug 14 05:54:07 PDT 2020


On Fri, Aug 14, 2020 at 7:15 AM Bruno Ricci via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> >>
> >> You can use a VariadicDynCastAllOfMatcher<Stmt, OffsetOfExpr> like the other matchers
> >> for statements/expressions. That said, why are we manually adding matchers for each nodes?
> >> It seems to me that they could be auto-generated from the statement/declaration/type databases.
> >
> > Each matcher we add increases the compile time overhead due to the
> > template instantiations involved, so we typically only add global
> > matchers where there's an expressed need for one rather than try to
> > add matchers for the entire AST automatically. That said, for node
> > matchers, I wonder how far off we are from supporting all node types
> > already (like, do we need 10 matchers? 100?). If we're only missing a
> > handful, then it might sense to consider auto-generating them all at
> > this point (and shifting the concern to traversal or narrowing
> > matchers), depending on how many we're missing.
> >
> > ~Aaron
> >
> For types we have 32/59
> For decls we have 47/94
> For stmts we have 92/227, or 91/168 excluding the OpenMP nodes.
>
> But note that the above count also includes abstract nodes.

Given those counts, I'd say we're probably not to the point where it
makes sense to generate node matchers automatically.

~Aaron

>
> ~Bruno
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list