From 2241ffa43cee14361757e9dbdee01161030d1656 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 11 Oct 2017 23:34:47 +0000 Subject: [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 --- llvm/lib/CodeGen/LLVMTargetMachine.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp') 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(MAB), Out, MCE, STI, - Options.MCOptions.MCRelaxAll, + T, Context, std::unique_ptr(MAB), Out, + std::unique_ptr(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 AsmStreamer(getTarget().createMCObjectStreamer( - T, *Ctx, std::unique_ptr(MAB), Out, MCE, STI, - Options.MCOptions.MCRelaxAll, + T, *Ctx, std::unique_ptr(MAB), Out, + std::unique_ptr(MCE), STI, Options.MCOptions.MCRelaxAll, Options.MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); -- cgit v1.2.3