[cfe-dev] match OffsetOfExpr

Bruno Ricci via cfe-dev cfe-dev at lists.llvm.org
Fri Aug 14 04:15:05 PDT 2020


>>
>> 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.

~Bruno


More information about the cfe-dev mailing list