aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index eea1459..157473a7 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -668,24 +668,22 @@ void MachObjectWriter::computeSymbolTable(
}
}
-void MachObjectWriter::computeSectionAddresses(const MCAssembler &Asm,
- const MCAsmLayout &Layout) {
+void MachObjectWriter::computeSectionAddresses(const MCAssembler &Asm) {
uint64_t StartAddress = 0;
- for (const MCSection *Sec : Layout.getSectionOrder()) {
+ for (const MCSection *Sec : Asm.getLayout()->getSectionOrder()) {
StartAddress = alignTo(StartAddress, Sec->getAlign());
SectionAddress[Sec] = StartAddress;
- StartAddress += Layout.getSectionAddressSize(Sec);
+ StartAddress += Asm.getSectionAddressSize(*Sec);
// Explicitly pad the section to match the alignment requirements of the
// following one. This is for 'gas' compatibility, it shouldn't
/// strictly be necessary.
- StartAddress += getPaddingSize(Sec, Layout);
+ StartAddress += getPaddingSize(Sec, *Asm.getLayout());
}
}
-void MachObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
- const MCAsmLayout &Layout) {
- computeSectionAddresses(Asm, Layout);
+void MachObjectWriter::executePostLayoutBinding(MCAssembler &Asm) {
+ computeSectionAddresses(Asm);
// Create symbol data for any indirect symbols.
bindIndirectSymbols(Asm);