Skip to content

Commit 716a389

Browse files
committed
Convert SpecialCaseList::Sections from StringMap to vector.
Created using spr 1.3.6
1 parent 4628b85 commit 716a389

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/include/llvm/Support/SpecialCaseList.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ class SpecialCaseList {
132132
using SectionEntries = StringMap<StringMap<Matcher>>;
133133

134134
struct Section {
135-
Section(std::unique_ptr<Matcher> M, StringRef str)
136-
: SectionMatcher(std::move(M)), SectionStr(SectionStr) {};
137-
Section(StringRef str) : Section(std::make_unique<Matcher>(), str) {};
135+
Section(std::unique_ptr<Matcher> M) : SectionMatcher(std::move(M)) {};
136+
Section() : Section(std::make_unique<Matcher>()) {};
138137

139138
std::unique_ptr<Matcher> SectionMatcher;
140139
SectionEntries Entries;

llvm/lib/Support/SpecialCaseList.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ bool SpecialCaseList::createInternal(const MemoryBuffer *MB,
132132
Expected<SpecialCaseList::Section *>
133133
SpecialCaseList::addSection(StringRef SectionStr, unsigned LineNo,
134134
bool UseGlobs) {
135-
Sections.emplace_back(SectionStr);
135+
Sections.emplace_back();
136136
auto &Section = Sections.back();
137+
Section.SectionStr = SectionStr;
137138

138139
if (auto Err = Section.SectionMatcher->insert(SectionStr, LineNo, UseGlobs)) {
139140
return createStringError(errc::invalid_argument,

0 commit comments

Comments
 (0)