Skip to content

Conversation

@qinkunbao
Copy link
Member

No description provided.

Created using spr 1.3.6
@llvmbot
Copy link
Member

llvmbot commented May 16, 2025

@llvm/pr-subscribers-llvm-support

Author: Qinkun Bao (qinkunbao)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/140184.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Support/SpecialCaseList.h (+2-3)
  • (modified) llvm/lib/Support/SpecialCaseList.cpp (+2-1)
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index 4f4c097c7162a..fc6dc93651f38 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -132,9 +132,8 @@ class SpecialCaseList {
   using SectionEntries = StringMap<StringMap<Matcher>>;
 
   struct Section {
-    Section(std::unique_ptr<Matcher> M, StringRef str)
-        : SectionMatcher(std::move(M)), SectionStr(SectionStr) {};
-    Section(StringRef str) : Section(std::make_unique<Matcher>(), str) {};
+    Section(std::unique_ptr<Matcher> M) : SectionMatcher(std::move(M)) {};
+    Section() : Section(std::make_unique<Matcher>()) {};
 
     std::unique_ptr<Matcher> SectionMatcher;
     SectionEntries Entries;
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 76c705c097aaa..9f044ced3a17c 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -132,8 +132,9 @@ bool SpecialCaseList::createInternal(const MemoryBuffer *MB,
 Expected<SpecialCaseList::Section *>
 SpecialCaseList::addSection(StringRef SectionStr, unsigned LineNo,
                             bool UseGlobs) {
-  Sections.emplace_back(SectionStr);
+  Sections.emplace_back();
   auto &Section = Sections.back();
+  Section.SectionStr = SectionStr;
 
   if (auto Err = Section.SectionMatcher->insert(SectionStr, LineNo, UseGlobs)) {
     return createStringError(errc::invalid_argument,

@qinkunbao qinkunbao deleted the users/qinkunbao/spr/fix-the-unit-test-errors branch May 19, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants