[MC] Allow MCObjectWriter's output stream to be swapped out
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 1 Sep 2015 16:19:03 +0000 (16:19 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 1 Sep 2015 16:19:03 +0000 (16:19 +0000)
commit919f1f47e4211b21877d74b0543ec53bf4a165c1
tree151c6d25b9d0cbc013cdc234681ef886aa28ee4f
parentc02bfc6060213092d4191f329a4b4729f198b587
[MC] Allow MCObjectWriter's output stream to be swapped out

There are occasions where it is useful to consider the entirety of the
contents of a section.  For example, compressed debug info needs the
entire section available before it can compress it and write it out.
The compressed debug info scenario was previously implemented by
mirroring the implementation of writeSectionData in the ELFObjectWriter.

Instead, allow the output stream to be swapped on demand.  This lets
callers redirect the output stream to a more convenient location before
it hits the object file.

No functionality change is intended.

Differential Revision: http://reviews.llvm.org/D12509

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246554 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCObjectWriter.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MachObjectWriter.cpp
lib/MC/WinCOFFObjectWriter.cpp