forked from OSchip/llvm-project
[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. llvm-svn: 246604
This commit is contained in:
parent
78471f0ec1
commit
83c862ad52
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue