MC: Change MCAssembler::writeSectionData and writeFragmentPadding to take a raw_ostream. NFCI.
Also clean up a couple of hacks where we were writing the section
contents to another stream by setting the object writer's stream,
writing and setting it back.
Part of PR37466.
Differential Revision: https://reviews.llvm.org/D47038
llvm-svn: 332858
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index e107d27..5f9f61c 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -919,7 +919,7 @@
// Write the actual section data.
for (const MCSection &Sec : Asm) {
- Asm.writeSectionData(&Sec, Layout);
+ Asm.writeSectionData(getStream(), &Sec, Layout);
uint64_t Pad = getPaddingSize(&Sec, Layout);
WriteZeros(Pad);