18
18
#include " llvm/ADT/StringRef.h"
19
19
#include " llvm/ADT/Twine.h"
20
20
#include " llvm/BinaryFormat/COFF.h"
21
- #include " llvm/MC/MCAsmLayout.h"
22
21
#include " llvm/MC/MCAssembler.h"
23
22
#include " llvm/MC/MCContext.h"
24
23
#include " llvm/MC/MCExpr.h"
@@ -188,15 +187,13 @@ class WinCOFFWriter {
188
187
void WriteAuxiliarySymbols (const COFFSymbol::AuxiliarySymbols &S);
189
188
void writeSectionHeaders ();
190
189
void WriteRelocation (const COFF::relocation &R);
191
- uint32_t writeSectionContents (MCAssembler &Asm, const MCAsmLayout &Layout,
192
- const MCSection &MCSec);
193
- void writeSection (MCAssembler &Asm, const MCAsmLayout &Layout,
194
- const COFFSection &Sec);
190
+ uint32_t writeSectionContents (MCAssembler &Asm, const MCSection &MCSec);
191
+ void writeSection (MCAssembler &Asm, const COFFSection &Sec);
195
192
196
193
void createFileSymbols (MCAssembler &Asm);
197
194
void setWeakDefaultNames ();
198
195
void assignSectionNumbers ();
199
- void assignFileOffsets (MCAssembler &Asm, const MCAsmLayout &Layout );
196
+ void assignFileOffsets (MCAssembler &Asm);
200
197
};
201
198
202
199
class WinCOFFObjectWriter : public MCObjectWriter {
@@ -601,7 +598,6 @@ void WinCOFFWriter::WriteRelocation(const COFF::relocation &R) {
601
598
// "Asm.writeSectionData(&MCSec)", but it's a bit complicated
602
599
// because it needs to compute a CRC.
603
600
uint32_t WinCOFFWriter::writeSectionContents (MCAssembler &Asm,
604
- const MCAsmLayout &Layout,
605
601
const MCSection &MCSec) {
606
602
// Save the contents of the section to a temporary buffer, we need this
607
603
// to CRC the data before we dump it into the object file.
@@ -619,8 +615,7 @@ uint32_t WinCOFFWriter::writeSectionContents(MCAssembler &Asm,
619
615
return JC.getCRC ();
620
616
}
621
617
622
- void WinCOFFWriter::writeSection (MCAssembler &Asm, const MCAsmLayout &Layout,
623
- const COFFSection &Sec) {
618
+ void WinCOFFWriter::writeSection (MCAssembler &Asm, const COFFSection &Sec) {
624
619
if (Sec.Number == -1 )
625
620
return ;
626
621
@@ -629,7 +624,7 @@ void WinCOFFWriter::writeSection(MCAssembler &Asm, const MCAsmLayout &Layout,
629
624
assert (W.OS .tell () == Sec.Header .PointerToRawData &&
630
625
" Section::PointerToRawData is insane!" );
631
626
632
- uint32_t CRC = writeSectionContents (Asm, Layout, *Sec.MCSection );
627
+ uint32_t CRC = writeSectionContents (Asm, *Sec.MCSection );
633
628
634
629
// Update the section definition auxiliary symbol to record the CRC.
635
630
COFFSymbol::AuxiliarySymbols &AuxSyms = Sec.Symbol ->Aux ;
@@ -761,8 +756,7 @@ void WinCOFFWriter::assignSectionNumbers() {
761
756
}
762
757
763
758
// Assign file offsets to COFF object file structures.
764
- void WinCOFFWriter::assignFileOffsets (MCAssembler &Asm,
765
- const MCAsmLayout &Layout) {
759
+ void WinCOFFWriter::assignFileOffsets (MCAssembler &Asm) {
766
760
unsigned Offset = W.OS .tell ();
767
761
768
762
Offset += UseBigObj ? COFF::Header32Size : COFF::Header16Size;
@@ -1127,7 +1121,7 @@ uint64_t WinCOFFWriter::writeObject(MCAssembler &Asm) {
1127
1121
}
1128
1122
}
1129
1123
1130
- assignFileOffsets (Asm, *Asm. getLayout () );
1124
+ assignFileOffsets (Asm);
1131
1125
1132
1126
// MS LINK expects to be able to use this timestamp to implement their
1133
1127
// /INCREMENTAL feature.
@@ -1157,7 +1151,7 @@ uint64_t WinCOFFWriter::writeObject(MCAssembler &Asm) {
1157
1151
1158
1152
// Write section contents.
1159
1153
for (std::unique_ptr<COFFSection> &Sec : Sections)
1160
- writeSection (Asm, *Asm. getLayout (), * Sec);
1154
+ writeSection (Asm, *Sec);
1161
1155
1162
1156
assert (W.OS .tell () == Header.PointerToSymbolTable &&
1163
1157
" Header::PointerToSymbolTable is insane!" );
0 commit comments