[clang-tools-extra] [clang-tidy] Speed up deduplicating warnings from alias checks (PR #174237)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 2 14:12:30 PST 2026
================
@@ -760,9 +758,9 @@ struct LessClangTidyError {
const tooling::DiagnosticMessage &M1 = LHS.Message;
const tooling::DiagnosticMessage &M2 = RHS.Message;
- return std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName,
- M1.Message) <
- std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);
+ return std::tie(M1.FilePath, M1.FileOffset, M1.Message,
+ LHS.DiagnosticName) <
+ std::tie(M2.FilePath, M2.FileOffset, M2.Message, RHS.DiagnosticName);
----------------
localspook wrote:
Having `DiagnosticName` (i.e. the check name) last means sorting using this predicate puts duplicate diagnostics into consecutive runs. This enables us to do away with the `UniqueErrorSet` in `removeDuplicatedDiagnosticsOfAliasCheckers`.
https://github.com/llvm/llvm-project/pull/174237
More information about the cfe-commits
mailing list