diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-21 18:11:35 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-21 18:11:35 +0000 |
commit | 147db3e628369d5d8cfee192647912ebaea28f0e (patch) | |
tree | 7d7e7c5165da3f8661810aabe8c564115fa46ef2 /llvm/lib/MC/WinCOFFObjectWriter.cpp | |
parent | 571a3301aeaaddcb1d784d8f27957170fe0cfd15 (diff) | |
download | bcm5719-llvm-147db3e628369d5d8cfee192647912ebaea28f0e.tar.gz bcm5719-llvm-147db3e628369d5d8cfee192647912ebaea28f0e.zip |
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
Diffstat (limited to 'llvm/lib/MC/WinCOFFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/WinCOFFObjectWriter.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp index b58902751b8..392bd026524 100644 --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -608,15 +608,7 @@ uint32_t WinCOFFObjectWriter::writeSectionContents(MCAssembler &Asm, // to CRC the data before we dump it into the object file. SmallVector<char, 128> Buf; raw_svector_ostream VecOS(Buf); - raw_pwrite_stream &OldStream = getStream(); - - // Redirect the output stream to our buffer and fill our buffer with - // the section data. - setStream(VecOS); - Asm.writeSectionData(&MCSec, Layout); - - // Reset the stream back to what it was before. - setStream(OldStream); + Asm.writeSectionData(VecOS, &MCSec, Layout); // Write the section contents to the object file. getStream() << Buf; |