mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 21:50:40 +00:00
[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:
parent
fc98f116be
commit
dc2d216543
@ -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
Block a user