summaryrefslogtreecommitdiffstats
path: root/lld/ELF/MapFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-02-24 15:07:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-02-24 15:07:30 +0000
commit24e6f363c5c9b9b01ca0c4fc066d2fb2edfc3b92 (patch)
tree40559ba922eb56024d5d9c15518d025c933f9ad4 /lld/ELF/MapFile.cpp
parent8d4d72f16b180397914dfd9505ce691be349c11a (diff)
downloadbcm5719-llvm-24e6f363c5c9b9b01ca0c4fc066d2fb2edfc3b92.tar.gz
bcm5719-llvm-24e6f363c5c9b9b01ca0c4fc066d2fb2edfc3b92.zip
Merge OutputSectionBase and OutputSection. NFC.
Now that all special sections are SyntheticSections, we only need one OutputSection class. llvm-svn: 296127
Diffstat (limited to 'lld/ELF/MapFile.cpp')
-rw-r--r--lld/ELF/MapFile.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 9fb58d95cc8..576e3dc878b 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -95,26 +95,25 @@ static void writeInputSection(raw_fd_ostream &OS, const InputSection *IS,
template <class ELFT>
static void writeMapFile2(raw_fd_ostream &OS,
- ArrayRef<OutputSectionBase *> OutputSections) {
+ ArrayRef<OutputSection *> OutputSections) {
int Width = ELFT::Is64Bits ? 16 : 8;
OS << left_justify("Address", Width) << ' ' << left_justify("Size", Width)
<< " Align Out In File Symbol\n";
- for (OutputSectionBase *Sec : OutputSections) {
+ for (OutputSection *Sec : OutputSections) {
writeOutSecLine(OS, Width, Sec->Addr, Sec->Size, Sec->Addralign, Sec->Name);
OS << '\n';
StringRef PrevName = "";
- Sec->forEachInputSection([&](InputSectionBase *S) {
- if (const auto *IS = dyn_cast<InputSection>(S))
- writeInputSection<ELFT>(OS, IS, PrevName);
- });
+ for (InputSection *IS : Sec->Sections) {
+ writeInputSection<ELFT>(OS, IS, PrevName);
+ }
}
}
template <class ELFT>
-void elf::writeMapFile(ArrayRef<OutputSectionBase *> OutputSections) {
+void elf::writeMapFile(ArrayRef<OutputSection *> OutputSections) {
if (Config->MapFile.empty())
return;
@@ -126,7 +125,7 @@ void elf::writeMapFile(ArrayRef<OutputSectionBase *> OutputSections) {
writeMapFile2<ELFT>(OS, OutputSections);
}
-template void elf::writeMapFile<ELF32LE>(ArrayRef<OutputSectionBase *>);
-template void elf::writeMapFile<ELF32BE>(ArrayRef<OutputSectionBase *>);
-template void elf::writeMapFile<ELF64LE>(ArrayRef<OutputSectionBase *>);
-template void elf::writeMapFile<ELF64BE>(ArrayRef<OutputSectionBase *>);
+template void elf::writeMapFile<ELF32LE>(ArrayRef<OutputSection *>);
+template void elf::writeMapFile<ELF32BE>(ArrayRef<OutputSection *>);
+template void elf::writeMapFile<ELF64LE>(ArrayRef<OutputSection *>);
+template void elf::writeMapFile<ELF64BE>(ArrayRef<OutputSection *>);
OpenPOWER on IntegriCloud