[MC] Remove MCAssembler's copy of OS

We can just ask the ObjectWriter for it's stream instead of caching
around our own reference to it.  No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2015-09-01 23:19:38 +00:00
parent fc98f116be
commit dc2d216543
3 changed files with 6 additions and 9 deletions

View File

@ -576,8 +576,6 @@ private:
MCObjectWriter &Writer;
raw_ostream &OS;
SectionListType Sections;
SymbolDataListType Symbols;
@ -723,8 +721,7 @@ public:
// option is to make this abstract, and have targets provide concrete
// implementations as we do with AsmParser.
MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
raw_ostream &OS);
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_);
~MCAssembler();
/// Reuse an assembler instance

View File

@ -325,11 +325,10 @@ void MCFragment::destroy() {
/* *** */
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
raw_ostream &OS_)
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_)
: Context(Context_), Backend(Backend_), Emitter(Emitter_), Writer(Writer_),
OS(OS_), BundleAlignSize(0), RelaxAll(false),
SubsectionsViaSymbols(false), ELFHeaderEFlags(0) {
BundleAlignSize(0), RelaxAll(false), SubsectionsViaSymbols(false),
ELFHeaderEFlags(0) {
VersionMinInfo.Major = 0; // Major version == 0 for "none specified"
}
@ -933,6 +932,7 @@ void MCAssembler::Finish() {
MCAsmLayout Layout(*this);
layout(Layout);
raw_ostream &OS = getWriter().getStream();
uint64_t StartOffset = OS.tell();
// Write the object file.

View File

@ -28,7 +28,7 @@ MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
MCCodeEmitter *Emitter_)
: MCStreamer(Context),
Assembler(new MCAssembler(Context, TAB, *Emitter_,
*TAB.createObjectWriter(OS), OS)),
*TAB.createObjectWriter(OS))),
EmitEHFrame(true), EmitDebugFrame(false) {}
MCObjectStreamer::~MCObjectStreamer() {