mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Special case the creation of relocation sections.
These sections are never looked up and we know when have to create them. Use that to save adding them to the regular map and avoid a symbol->string->symbol conversion for the group symbol. This also makes the implementation independent of the details of how unique sections are implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -275,6 +275,18 @@ void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) {
|
||||
const_cast<MCSectionELF*>(Section)->setSectionName(CachedName);
|
||||
}
|
||||
|
||||
const MCSectionELF *
|
||||
MCContext::createELFRelSection(StringRef Name, unsigned Type, unsigned Flags,
|
||||
unsigned EntrySize, const MCSymbol *Group) {
|
||||
StringMap<bool>::iterator I;
|
||||
bool Inserted;
|
||||
std::tie(I, Inserted) = ELFRelSecNames.insert(std::make_pair(Name, true));
|
||||
|
||||
return new (*this)
|
||||
MCSectionELF(I->getKey(), Type, Flags, SectionKind::getReadOnly(),
|
||||
EntrySize, Group, true, nullptr);
|
||||
}
|
||||
|
||||
const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
|
||||
unsigned Flags, unsigned EntrySize,
|
||||
StringRef Group, bool Unique,
|
||||
|
Reference in New Issue
Block a user