Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions llvm/include/llvm/Support/SpecialCaseList.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Support/SpecialCaseList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.