njames93 added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/readability/UseEarlyExitsCheck.cpp:359
+void UseEarlyExitsCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(translationUnitDecl(), this);
+}
----------------
PiotrZSL wrote:
> This will trigger on all system code, and then users will complain again that 
> they see poor clang-tidy performance...
> 
> when it could be just something like
> 
> ```
> ifStmt(unless(isExpansionInSystemHeader()),
>        unless(isConsteval()),
>        unless(isConstexpr()),
>        unless(hasElse(stmt())),
>        unless(hasInitStatement(stmt()),
>        hasThen(compoundStmt(hasSizeAboeLineTreshold())),
>        ...
> ```
> 
> Simply everything that could be put into matcher should be put into matcher 
> (easier to maintain), also what's a point of checking functions that doesn't 
> have if's. On that point also some implicit functions or if statement should 
> be ignored, to avoid checking templates twice.
> 
Not triggering on system headers is a good point, but for raw performance, that 
code is better residing in the visitor,  which can massively outperform 
matchers as we can straight up ignore huge blocks of code that aren't of 
interest.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130181

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to