diff options
author | Lang Hames <lhames@gmail.com> | 2017-10-11 01:57:21 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2017-10-11 01:57:21 +0000 |
commit | 02d330548d07cfbbb7cd496c94a514802527dfeb (patch) | |
tree | 60e57bf4af3cfd30f61c5f4b4349aa2f0aef197f /llvm/lib/MC/MCELFStreamer.cpp | |
parent | 6b394caaf1c84ecd73469eacebba9453f9772552 (diff) | |
download | bcm5719-llvm-02d330548d07cfbbb7cd496c94a514802527dfeb.tar.gz bcm5719-llvm-02d330548d07cfbbb7cd496c94a514802527dfeb.zip |
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
MCObjectStreamer owns its MCAsmBackend -- this fixes the types to reflect that,
and allows us to remove another instance of MCObjectStreamer's weird "holding
ownership via someone else's reference" trick.
llvm-svn: 315410
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index 76976cab466..4fdbcd7511c 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -39,6 +39,11 @@ using namespace llvm; +MCELFStreamer::MCELFStreamer(MCContext &Context, + std::unique_ptr<MCAsmBackend> TAB, + raw_pwrite_stream &OS, MCCodeEmitter *Emitter) + : MCObjectStreamer(Context, std::move(TAB), OS, Emitter) {} + bool MCELFStreamer::isBundleLocked() const { return getCurrentSectionOnly()->isBundleLocked(); } @@ -639,10 +644,11 @@ void MCELFStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, llvm_unreachable("ELF doesn't support this directive"); } -MCStreamer *llvm::createELFStreamer(MCContext &Context, MCAsmBackend &MAB, +MCStreamer *llvm::createELFStreamer(MCContext &Context, + std::unique_ptr<MCAsmBackend> &&MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE, bool RelaxAll) { - MCELFStreamer *S = new MCELFStreamer(Context, MAB, OS, CE); + MCELFStreamer *S = new MCELFStreamer(Context, std::move(MAB), OS, CE); if (RelaxAll) S->getAssembler().setRelaxAll(true); return S; |