aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-05-26 02:17:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-05-26 02:17:21 +0000
commit64acc7fcc79d789daf0559f5d254aa7dbfa3708e (patch)
tree24fafa7069df5cd4fe80201e3d794b4fb60890d3 /llvm/lib/MC/MachObjectWriter.cpp
parent5a1e80bc437db7f4fe9e62abd9c459c7000cade6 (diff)
downloadllvm-64acc7fcc79d789daf0559f5d254aa7dbfa3708e.zip
llvm-64acc7fcc79d789daf0559f5d254aa7dbfa3708e.tar.gz
llvm-64acc7fcc79d789daf0559f5d254aa7dbfa3708e.tar.bz2
Remove most uses of MCSectionData from MCAssembler.
llvm-svn: 238172
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 7a42001..4468520 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -478,8 +478,7 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) {
// or stub section.
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
ie = Asm.indirect_symbol_end(); it != ie; ++it) {
- const MCSectionMachO &Section =
- cast<MCSectionMachO>(it->SectionData->getSection());
+ const MCSectionMachO &Section = cast<MCSectionMachO>(*it->Section);
if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS &&
Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS &&
@@ -494,15 +493,13 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) {
unsigned IndirectIndex = 0;
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
ie = Asm.indirect_symbol_end(); it != ie; ++it, ++IndirectIndex) {
- const MCSectionMachO &Section =
- cast<MCSectionMachO>(it->SectionData->getSection());
+ const MCSectionMachO &Section = cast<MCSectionMachO>(*it->Section);
if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS)
continue;
// Initialize the section indirect symbol base, if necessary.
- IndirectSymBase.insert(
- std::make_pair(&it->SectionData->getSection(), IndirectIndex));
+ IndirectSymBase.insert(std::make_pair(it->Section, IndirectIndex));
Asm.getOrCreateSymbolData(*it->Symbol);
}
@@ -511,16 +508,14 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) {
IndirectIndex = 0;
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
ie = Asm.indirect_symbol_end(); it != ie; ++it, ++IndirectIndex) {
- const MCSectionMachO &Section =
- cast<MCSectionMachO>(it->SectionData->getSection());
+ const MCSectionMachO &Section = cast<MCSectionMachO>(*it->Section);
if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS &&
Section.getType() != MachO::S_SYMBOL_STUBS)
continue;
// Initialize the section indirect symbol base, if necessary.
- IndirectSymBase.insert(
- std::make_pair(&it->SectionData->getSection(), IndirectIndex));
+ IndirectSymBase.insert(std::make_pair(it->Section, IndirectIndex));
// Set the symbol type to undefined lazy, but only on construction.
//
@@ -913,10 +908,10 @@ void MachObjectWriter::WriteObject(MCAssembler &Asm,
// Write the actual section data.
for (MCAssembler::const_iterator it = Asm.begin(),
ie = Asm.end(); it != ie; ++it) {
- const MCSectionData &SD = it->getSectionData();
- Asm.writeSectionData(&SD, Layout);
+ MCSection &Sec = *it;
+ Asm.writeSectionData(&Sec, Layout);
- uint64_t Pad = getPaddingSize(&*it, Layout);
+ uint64_t Pad = getPaddingSize(&Sec, Layout);
WriteZeros(Pad);
}
@@ -972,7 +967,7 @@ void MachObjectWriter::WriteObject(MCAssembler &Asm,
// Indirect symbols in the non-lazy symbol pointer section have some
// special handling.
const MCSectionMachO &Section =
- static_cast<const MCSectionMachO&>(it->SectionData->getSection());
+ static_cast<const MCSectionMachO &>(*it->Section);
if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) {
// If this symbol is defined and internal, mark it as such.
if (it->Symbol->isDefined() &&