diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-27 21:34:24 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-27 21:34:24 +0000 |
commit | 44d5057e38e650ebb03a3f2095cc698fe657e5bd (patch) | |
tree | ad7f430948fa9c88c51be54fa30f252b88feb920 /llvm/lib/MC/MCContext.cpp | |
parent | e802387476f5af62b2a8278b6df8eb2167689247 (diff) | |
download | bcm5719-llvm-44d5057e38e650ebb03a3f2095cc698fe657e5bd.tar.gz bcm5719-llvm-44d5057e38e650ebb03a3f2095cc698fe657e5bd.zip |
Add two small structs for readability in place of std::pair and std::tuple. NFC.
llvm-svn: 233422
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 3cb3ea12afd..09de4ee05e6 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -268,11 +268,10 @@ void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) { if (const MCSymbol *Group = Section->getGroup()) GroupName = Group->getName(); - ELFUniquingMap.erase(SectionGroupPair(Section->getSectionName(), GroupName)); - auto I = - ELFUniquingMap.insert(std::make_pair(SectionGroupPair(Name, GroupName), - Section)).first; - StringRef CachedName = I->first.first; + ELFUniquingMap.erase(ELFSectionKey{Section->getSectionName(), GroupName}); + auto I = ELFUniquingMap.insert(std::make_pair(ELFSectionKey{Name, GroupName}, + Section)).first; + StringRef CachedName = I->first.SectionName; const_cast<MCSectionELF*>(Section)->setSectionName(CachedName); } @@ -282,7 +281,7 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, const char *BeginSymName) { // Do the lookup, if we have a hit, return it. auto IterBool = ELFUniquingMap.insert( - std::make_pair(SectionGroupPair(Section, Group), nullptr)); + std::make_pair(ELFSectionKey{Section, Group}, nullptr)); auto &Entry = *IterBool.first; if (!IterBool.second && !Unique) return Entry.second; @@ -291,7 +290,7 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, if (!Group.empty()) GroupSym = GetOrCreateSymbol(Group); - StringRef CachedName = Entry.first.first; + StringRef CachedName = Entry.first.SectionName; SectionKind Kind; if (Flags & ELF::SHF_EXECINSTR) @@ -331,7 +330,7 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics, int Selection, const char *BeginSymName) { // Do the lookup, if we have a hit, return it. - SectionGroupTriple T(Section, COMDATSymName, Selection); + COFFSectionKey T{Section, COMDATSymName, Selection}; auto IterBool = COFFUniquingMap.insert(std::make_pair(T, nullptr)); auto Iter = IterBool.first; if (!IterBool.second) @@ -345,7 +344,7 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics, if (BeginSymName) Begin = createTempSymbol(BeginSymName, false); - StringRef CachedName = std::get<0>(Iter->first); + StringRef CachedName = Iter->first.SectionName; MCSectionCOFF *Result = new (*this) MCSectionCOFF( CachedName, Characteristics, COMDATSymbol, Selection, Kind, Begin); @@ -361,7 +360,7 @@ const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section, } const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section) { - SectionGroupTriple T(Section, "", 0); + COFFSectionKey T{Section, "", 0}; auto Iter = COFFUniquingMap.find(T); if (Iter == COFFUniquingMap.end()) return nullptr; |