[clang-tools-extra] [clang-tidy] Rename performance-faster-string-find to performance-prefer-single-char-overloads (PR #186946)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 29 22:33:24 PDT 2026
================
@@ -91,6 +92,13 @@ void FasterStringFindCheck::check(const MatchFinder::MatchResult &Result) {
"efficient overload accepting a character")
<< FindFunc
<< FixItHint::CreateReplacement(Literal->getSourceRange(), *Replacement);
+
+ if (getID() == "performance-faster-string-find")
+ diag(Literal->getBeginLoc(),
+ "performance-faster-string-find is deprecated and will be removed in "
+ "future release, consider using "
+ "performance-prefer-single-char-overloads",
+ DiagnosticIDs::Note);
----------------
localspook wrote:
Having a reusable check deprecation mechanism sounds like a great approach. I'm kinda surprised we don't already have one. I guess we don't deprecate checks that often, so it hasn't come up before?
> My current thought is to remove the notes in this PR for now, and add them back after we finish the helper in ClangTidyDiagnosticConsumer. WDYT?
When you say this, do you mean merge this PR without the note and add it later, or block this PR until the helper is implemented? (I'm fine either way, just want to confirm)
https://github.com/llvm/llvm-project/pull/186946
More information about the cfe-commits
mailing list