diff options
author | Lang Hames <lhames@gmail.com> | 2017-10-11 23:34:47 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2017-10-11 23:34:47 +0000 |
commit | 2241ffa43cee14361757e9dbdee01161030d1656 (patch) | |
tree | 5c45b1e1a054f4ed236085ece5cc97200b5dc230 /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 337462b36512cc001891a98fb98fa5693651722f (diff) | |
download | bcm5719-llvm-2241ffa43cee14361757e9dbdee01161030d1656.tar.gz bcm5719-llvm-2241ffa43cee14361757e9dbdee01161030d1656.zip |
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
MCObjectStreamer owns its MCCodeEmitter -- this fixes the types to reflect that,
and allows us to remove the last instance of MCObjectStreamer's weird "holding
ownership via someone else's reference" trick.
llvm-svn: 315531
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 00db011697f..e829409f097 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -22,6 +22,7 @@ #include "llvm/IR/Verifier.h" #include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCStreamer.h" @@ -164,8 +165,8 @@ bool LLVMTargetMachine::addAsmPrinter(PassManagerBase &PM, Triple T(getTargetTriple().str()); AsmStreamer.reset(getTarget().createMCObjectStreamer( - T, Context, std::unique_ptr<MCAsmBackend>(MAB), Out, MCE, STI, - Options.MCOptions.MCRelaxAll, + T, Context, std::unique_ptr<MCAsmBackend>(MAB), Out, + std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll, Options.MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); break; @@ -240,8 +241,8 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, const Triple &T = getTargetTriple(); const MCSubtargetInfo &STI = *getMCSubtargetInfo(); std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer( - T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), Out, MCE, STI, - Options.MCOptions.MCRelaxAll, + T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), Out, + std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll, Options.MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); |