summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-04-06 03:09:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-04-06 03:09:30 +0000
commitb73b70ebffe6620f16bbbedf576962600400cb52 (patch)
tree5e0b78af3a48a1c0793df6283dcf8b38f0567275 /llvm/lib/MC/MCContext.cpp
parente51ab6e200444d0e8079689255f893b819c681eb (diff)
downloadbcm5719-llvm-b73b70ebffe6620f16bbbedf576962600400cb52.tar.gz
bcm5719-llvm-b73b70ebffe6620f16bbbedf576962600400cb52.zip
Simplify mapping from relocation sections to relocated sections.
Just store the section in MCSectionELF. This avoids multiple hash lookups. This will also be used by ARM_EXIDX. llvm-svn: 234139
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 34932ccd33a..211f1640652 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -279,14 +279,15 @@ void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) {
const MCSectionELF *
MCContext::createELFRelSection(StringRef Name, unsigned Type, unsigned Flags,
- unsigned EntrySize, const MCSymbol *Group) {
+ unsigned EntrySize, const MCSymbol *Group,
+ const MCSectionELF *Associated) {
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);
+ EntrySize, Group, true, nullptr, Associated);
}
const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
@@ -318,8 +319,9 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
if (BeginSymName)
Begin = createTempSymbol(BeginSymName, false);
- MCSectionELF *Result = new (*this) MCSectionELF(
- CachedName, Type, Flags, Kind, EntrySize, GroupSym, UniqueID, Begin);
+ MCSectionELF *Result =
+ new (*this) MCSectionELF(CachedName, Type, Flags, Kind, EntrySize,
+ GroupSym, UniqueID, Begin, nullptr);
Entry.second = Result;
return Result;
}
@@ -327,7 +329,7 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
const MCSectionELF *MCContext::CreateELFGroupSection() {
MCSectionELF *Result = new (*this)
MCSectionELF(".group", ELF::SHT_GROUP, 0, SectionKind::getReadOnly(), 4,
- nullptr, ~0, nullptr);
+ nullptr, ~0, nullptr, nullptr);
return Result;
}
OpenPOWER on IntegriCloud