[llvm-branch-commits] [NFC][Support] Remove unused getLongestMatch from SpecialCaseList (PR #167193)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Nov 8 17:09:44 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Vitaly Buka (vitalybuka)
<details>
<summary>Changes</summary>
This method is not used anywhere. Remove it.
---
Full diff: https://github.com/llvm/llvm-project/pull/167193.diff
2 Files Affected:
- (modified) llvm/include/llvm/Support/SpecialCaseList.h (-5)
- (modified) llvm/lib/Support/SpecialCaseList.cpp (-13)
``````````diff
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index cb8e568de02e0..a10bbc61dcc3e 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -218,11 +218,6 @@ class SpecialCaseList {
LLVM_ABI unsigned getLastMatch(StringRef Prefix, StringRef Query,
StringRef Category) const;
- // Helper method to search by Prefix, Query, and Category. Returns
- // matching rule, or empty string if there is no match.
- LLVM_ABI StringRef getLongestMatch(StringRef Prefix, StringRef Query,
- StringRef Category) const;
-
private:
friend class SpecialCaseList;
LLVM_ABI void preprocess(bool OrderBySize);
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 246d90cce3a43..813fce35d88fe 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -380,17 +380,4 @@ unsigned SpecialCaseList::Section::getLastMatch(StringRef Prefix,
return LastLine;
}
-StringRef SpecialCaseList::Section::getLongestMatch(StringRef Prefix,
- StringRef Query,
- StringRef Category) const {
- StringRef LongestRule;
- if (const Matcher *M = findMatcher(Prefix, Category)) {
- M->match(Query, [&](StringRef Rule, unsigned) {
- if (LongestRule.size() < Rule.size())
- LongestRule = Rule;
- });
- }
- return LongestRule;
-}
-
} // namespace llvm
``````````
</details>
https://github.com/llvm/llvm-project/pull/167193
More information about the llvm-branch-commits
mailing list