[PATCH] D143851: [clang-tidy] Tweak 'rule of 3/5' checks to allow defaulting a destructor outside the class.

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 10:48:16 PST 2023


ClockMan added a comment.

In D143851#4126615 <https://reviews.llvm.org/D143851#4126615>, @carlosgalvezp wrote:

> Yes, clang-tidy will not issue warnings in system headers, so checks should not need to explicitly handle that.

That's not so simple. At work we use clang-tidy for few big projects. I had to explicitly add to some checks `unless(isExpansionInSystemHeader())` to gain some performance improvement of clang-tidy. This check is one of them.
Problem is that some matchers or `check` methods in checks are heavy, and when you got lot of system headers (boost, STL, generated interfaces, message structs, ...) you may end up easily with hundreds of hidden issues from single translation unit.
For some checks explicit exclude of system headers gives ~50% performance improvement, that result in faster CI feedback.

Best would be to have something more generic like: if --system-headers is not used, then exclude code as early as possible, before even constructing diagnostic information.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143851



More information about the cfe-commits mailing list