[PATCH] D125026: [clang-tidy][NFC] Reimplement SimplifyBooleanExpr with RecursiveASTVisitors

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 17 10:58:32 PDT 2022


njames93 added a comment.

In D125026#3519831 <https://reviews.llvm.org/D125026#3519831>, @LegalizeAdulthood wrote:

> Just for my own edification, how did you know/suspect that a pure visitor would be faster than matchers?

Mainly cause the fact we are creating 2 matcher expressions that differ by a bool value for each pattern, a visitor can easily handle both cases in one go.
There's also overhead with ASTMatchers that for simple cases sometimes may not be worth it.
It's not all good news though, there's a cost associated with running another ASTTraversal, however as we already have a visitor in this check we don't pay for that cost again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125026



More information about the cfe-commits mailing list