[PATCH] D116328: [ast-matchers] Add hasSubstatement() traversal matcher for caseStmt(), defaultStmt(), labelStmt()

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 13 11:02:05 PST 2022


aaron.ballman added a comment.

In D116328#3223344 <https://reviews.llvm.org/D116328#3223344>, @LegalizeAdulthood wrote:

> My takeaway:
>
> - if `has` isn't expensive, I can either ditch this public matcher or move it to be a private matcher used in my check

I don't think `has()` is particularly expensive, so I think you should be able to use it directly. However, if you profiled something and notice a measurable difference between `has()` and `hasSubstatement()` in practice, that would be really good for the community to know.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116328/new/

https://reviews.llvm.org/D116328



More information about the cfe-commits mailing list