diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h index cb8e568de02e0..3e7592f153c25 100644 --- a/llvm/include/llvm/Support/SpecialCaseList.h +++ b/llvm/include/llvm/Support/SpecialCaseList.h @@ -166,10 +166,10 @@ class SpecialCaseList { std::vector Globs; - RadixTree, - RadixTree, + RadixTree, + RadixTree, SmallVector>> - PrefixSuffixToGlob; + SuffixPrefixToGlob; RadixTree, SmallVector> diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp index 33261695cd3e8..f9c2af01ca591 100644 --- a/llvm/lib/Support/SpecialCaseList.cpp +++ b/llvm/lib/Support/SpecialCaseList.cpp @@ -107,8 +107,8 @@ void SpecialCaseList::GlobMatcher::preprocess(bool BySize) { } } - auto &SToGlob = PrefixSuffixToGlob.emplace(Prefix).first->second; - auto &V = SToGlob.emplace(reverse(Suffix)).first->second; + auto &PToGlob = SuffixPrefixToGlob.emplace(reverse(Suffix)).first->second; + auto &V = PToGlob.emplace(Prefix).first->second; V.emplace_back(&G); } } @@ -116,9 +116,10 @@ void SpecialCaseList::GlobMatcher::preprocess(bool BySize) { void SpecialCaseList::GlobMatcher::match( StringRef Query, llvm::function_ref Cb) const { - if (!PrefixSuffixToGlob.empty()) { - for (const auto &[_, SToGlob] : PrefixSuffixToGlob.find_prefixes(Query)) { - for (const auto &[_, V] : SToGlob.find_prefixes(reverse(Query))) { + if (!SuffixPrefixToGlob.empty()) { + for (const auto &[_, PToGlob] : + SuffixPrefixToGlob.find_prefixes(reverse(Query))) { + for (const auto &[_, V] : PToGlob.find_prefixes(Query)) { for (const auto *G : V) { if (G->Pattern.match(Query)) { Cb(G->Name, G->LineNo);