aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-07-01 10:47:46 -0700
committerFangrui Song <i@maskray.me>2024-07-01 10:47:46 -0700
commit6b707a8cc143f094b02393f4faf89025c64520bb (patch)
tree833983f7afd3c03cf4473b94d3dea6ea4f76630f /llvm/lib/MC/MachObjectWriter.cpp
parent75ec24e875762f038bf490d6e3fa5d4743d7afd1 (diff)
downloadllvm-6b707a8cc143f094b02393f4faf89025c64520bb.zip
llvm-6b707a8cc143f094b02393f4faf89025c64520bb.tar.gz
llvm-6b707a8cc143f094b02393f4faf89025c64520bb.tar.bz2
[MC] Remove the MCAsmLayout parameter from MCObjectWriter::executePostLayoutBinding
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);