mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Pull out a named variable for the cached section names to aid readability.
Based on a code review suggestion from Eric Christopher in r205990 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -241,7 +241,8 @@ void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) {
|
||||
auto I =
|
||||
ELFUniquingMap.insert(std::make_pair(SectionGroupPair(Name, GroupName),
|
||||
Section)).first;
|
||||
const_cast<MCSectionELF*>(Section)->setSectionName(I->first.first);
|
||||
StringRef CachedName = I->first.first;
|
||||
const_cast<MCSectionELF*>(Section)->setSectionName(CachedName);
|
||||
}
|
||||
|
||||
const MCSectionELF *MCContext::
|
||||
@@ -262,8 +263,9 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
|
||||
if (!Group.empty())
|
||||
GroupSym = GetOrCreateSymbol(Group);
|
||||
|
||||
MCSectionELF *Result = new (*this) MCSectionELF(
|
||||
Entry.first.first, Type, Flags, Kind, EntrySize, GroupSym);
|
||||
StringRef CachedName = Entry.first.first;
|
||||
MCSectionELF *Result = new (*this)
|
||||
MCSectionELF(CachedName, Type, Flags, Kind, EntrySize, GroupSym);
|
||||
Entry.second = Result;
|
||||
return Result;
|
||||
}
|
||||
@@ -291,9 +293,9 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics,
|
||||
if (!COMDATSymName.empty())
|
||||
COMDATSymbol = GetOrCreateSymbol(COMDATSymName);
|
||||
|
||||
MCSectionCOFF *Result =
|
||||
new (*this) MCSectionCOFF(Iter->first.first, Characteristics,
|
||||
COMDATSymbol, Selection, Assoc, Kind);
|
||||
StringRef CachedName = Iter->first.first;
|
||||
MCSectionCOFF *Result = new (*this) MCSectionCOFF(
|
||||
CachedName, Characteristics, COMDATSymbol, Selection, Assoc, Kind);
|
||||
|
||||
Iter->second = Result;
|
||||
return Result;
|
||||
|
Reference in New Issue
Block a user