[llvm] r315531 - [MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 16:34:47 PDT 2017
Author: lhames
Date: Wed Oct 11 16:34:47 2017
New Revision: 315531
URL: http://llvm.org/viewvc/llvm-project?rev=315531&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/MC/MCELFStreamer.h
llvm/trunk/include/llvm/MC/MCObjectStreamer.h
llvm/trunk/include/llvm/MC/MCWasmStreamer.h
llvm/trunk/include/llvm/MC/MCWinCOFFStreamer.h
llvm/trunk/include/llvm/Support/TargetRegistry.h
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/lib/MC/MCELFStreamer.cpp
llvm/trunk/lib/MC/MCMachOStreamer.cpp
llvm/trunk/lib/MC/MCObjectStreamer.cpp
llvm/trunk/lib/MC/MCWasmStreamer.cpp
llvm/trunk/lib/MC/MCWinCOFFStreamer.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h
llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp
llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h
llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp
llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
llvm/trunk/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp
llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
llvm/trunk/tools/dsymutil/DwarfLinker.cpp
llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
Modified: llvm/trunk/include/llvm/MC/MCELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCELFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCELFStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCELFStreamer.h Wed Oct 11 16:34:47 2017
@@ -24,7 +24,7 @@ class MCInst;
class MCELFStreamer : public MCObjectStreamer {
public:
MCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter);
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter);
~MCELFStreamer() override = default;
@@ -92,8 +92,8 @@ private:
MCELFStreamer *createARMELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
- bool IsThumb);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll, bool IsThumb);
} // end namespace llvm
Modified: llvm/trunk/include/llvm/MC/MCObjectStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectStreamer.h Wed Oct 11 16:34:47 2017
@@ -36,6 +36,7 @@ class raw_pwrite_stream;
class MCObjectStreamer : public MCStreamer {
std::unique_ptr<MCObjectWriter> ObjectWriter;
std::unique_ptr<MCAsmBackend> TAB;
+ std::unique_ptr<MCCodeEmitter> Emitter;
std::unique_ptr<MCAssembler> Assembler;
MCSection::iterator CurInsertionPoint;
bool EmitEHFrame;
@@ -49,8 +50,9 @@ class MCObjectStreamer : public MCStream
protected:
MCObjectStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter);
- ~MCObjectStreamer() override;
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter);
+ ~MCObjectStreamer();
public:
/// state management
Modified: llvm/trunk/include/llvm/MC/MCWasmStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCWasmStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCWasmStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCWasmStreamer.h Wed Oct 11 16:34:47 2017
@@ -27,8 +27,8 @@ class raw_ostream;
class MCWasmStreamer : public MCObjectStreamer {
public:
MCWasmStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
- : MCObjectStreamer(Context, std::move(TAB), OS, Emitter),
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCObjectStreamer(Context, std::move(TAB), OS, std::move(Emitter)),
SeenIdent(false) {}
~MCWasmStreamer() override;
Modified: llvm/trunk/include/llvm/MC/MCWinCOFFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCWinCOFFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCWinCOFFStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCWinCOFFStreamer.h Wed Oct 11 16:34:47 2017
@@ -28,7 +28,7 @@ class raw_pwrite_stream;
class MCWinCOFFStreamer : public MCObjectStreamer {
public:
MCWinCOFFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
- MCCodeEmitter &CE, raw_pwrite_stream &OS);
+ std::unique_ptr<MCCodeEmitter> CE, raw_pwrite_stream &OS);
/// state management
void reset() override {
Modified: llvm/trunk/include/llvm/Support/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TargetRegistry.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Support/TargetRegistry.h Wed Oct 11 16:34:47 2017
@@ -69,16 +69,19 @@ MCStreamer *createAsmStreamer(MCContext
/// Takes ownership of \p TAB and \p CE.
MCStreamer *createELFStreamer(MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll);
MCStreamer *createMachOStreamer(MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll, bool DWARFMustBeAtTheEnd,
bool LabelSections = false);
MCStreamer *createWasmStreamer(MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll);
MCRelocationInfo *createMCRelocationInfo(const Triple &TT, MCContext &Ctx);
@@ -137,22 +140,26 @@ public:
using MCCodeEmitterCtorTy = MCCodeEmitter *(*)(const MCInstrInfo &II,
const MCRegisterInfo &MRI,
MCContext &Ctx);
- using ELFStreamerCtorTy = MCStreamer *(*)(const Triple &T, MCContext &Ctx,
- std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
- bool RelaxAll);
+ using ELFStreamerCtorTy =
+ MCStreamer *(*)(const Triple &T, MCContext &Ctx,
+ std::unique_ptr<MCAsmBackend> &&TAB,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll);
using MachOStreamerCtorTy =
MCStreamer *(*)(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
- bool RelaxAll, bool DWARFMustBeAtTheEnd);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
+ bool DWARFMustBeAtTheEnd);
using COFFStreamerCtorTy =
MCStreamer *(*)(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
- bool RelaxAll, bool IncrementalLinkerCompatible);
- using WasmStreamerCtorTy = MCStreamer
- *(*)(const Triple &T, MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
+ bool IncrementalLinkerCompatible);
+ using WasmStreamerCtorTy =
+ MCStreamer *(*)(const Triple &T, MCContext &Ctx,
+ std::unique_ptr<MCAsmBackend> &&TAB,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll);
using NullTargetStreamerCtorTy = MCTargetStreamer *(*)(MCStreamer &S);
using AsmTargetStreamerCtorTy = MCTargetStreamer *(*)(
MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint,
@@ -436,7 +443,7 @@ public:
MCStreamer *createMCObjectStreamer(const Triple &T, MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
const MCSubtargetInfo &STI, bool RelaxAll,
bool IncrementalLinkerCompatible,
bool DWARFMustBeAtTheEnd) const {
@@ -446,28 +453,32 @@ public:
llvm_unreachable("Unknown object format");
case Triple::COFF:
assert(T.isOSWindows() && "only Windows COFF is supported");
- S = COFFStreamerCtorFn(Ctx, std::move(TAB), OS, Emitter, RelaxAll,
- IncrementalLinkerCompatible);
+ S = COFFStreamerCtorFn(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll, IncrementalLinkerCompatible);
break;
case Triple::MachO:
if (MachOStreamerCtorFn)
- S = MachOStreamerCtorFn(Ctx, std::move(TAB), OS, Emitter, RelaxAll,
- DWARFMustBeAtTheEnd);
+ S = MachOStreamerCtorFn(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll, DWARFMustBeAtTheEnd);
else
- S = createMachOStreamer(Ctx, std::move(TAB), OS, Emitter, RelaxAll,
- DWARFMustBeAtTheEnd);
+ S = createMachOStreamer(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll, DWARFMustBeAtTheEnd);
break;
case Triple::ELF:
if (ELFStreamerCtorFn)
- S = ELFStreamerCtorFn(T, Ctx, std::move(TAB), OS, Emitter, RelaxAll);
+ S = ELFStreamerCtorFn(T, Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll);
else
- S = createELFStreamer(Ctx, std::move(TAB), OS, Emitter, RelaxAll);
+ S = createELFStreamer(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll);
break;
case Triple::Wasm:
if (WasmStreamerCtorFn)
- S = WasmStreamerCtorFn(T, Ctx, std::move(TAB), OS, Emitter, RelaxAll);
+ S = WasmStreamerCtorFn(T, Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll);
else
- S = createWasmStreamer(Ctx, std::move(TAB), OS, Emitter, RelaxAll);
+ S = createWasmStreamer(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll);
break;
}
if (ObjectTargetStreamerCtorFn)
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Oct 11 16:34:47 2017
@@ -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(Pa
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::addPassesToEmitM
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));
Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -41,8 +41,9 @@ 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) {}
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCObjectStreamer(Context, std::move(TAB), OS, std::move(Emitter)) {}
bool MCELFStreamer::isBundleLocked() const {
return getCurrentSectionOnly()->isBundleLocked();
@@ -646,9 +647,11 @@ void MCELFStreamer::EmitTBSSSymbol(MCSec
MCStreamer *llvm::createELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll) {
- MCELFStreamer *S = new MCELFStreamer(Context, std::move(MAB), OS, CE);
+ MCELFStreamer *S =
+ new MCELFStreamer(Context, std::move(MAB), OS, std::move(CE));
if (RelaxAll)
S->getAssembler().setRelaxAll(true);
return S;
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -63,9 +63,9 @@ private:
public:
MCMachOStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
bool DWARFMustBeAtTheEnd, bool label)
- : MCObjectStreamer(Context, std::move(MAB), OS, Emitter),
+ : MCObjectStreamer(Context, std::move(MAB), OS, std::move(Emitter)),
LabelSections(label), DWARFMustBeAtTheEnd(DWARFMustBeAtTheEnd),
CreatedADWARFSection(false) {}
@@ -487,11 +487,13 @@ void MCMachOStreamer::FinishImpl() {
MCStreamer *llvm::createMachOStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll, bool DWARFMustBeAtTheEnd,
bool LabelSections) {
- MCMachOStreamer *S = new MCMachOStreamer(Context, std::move(MAB), OS, CE,
- DWARFMustBeAtTheEnd, LabelSections);
+ MCMachOStreamer *S =
+ new MCMachOStreamer(Context, std::move(MAB), OS, std::move(CE),
+ DWARFMustBeAtTheEnd, LabelSections);
const Triple &TT = Context.getObjectFileInfo()->getTargetTriple();
if (TT.isOSDarwin()) {
unsigned Major, Minor, Update;
Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -28,15 +28,14 @@ using namespace llvm;
MCObjectStreamer::MCObjectStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter_)
+ std::unique_ptr<MCCodeEmitter> Emitter)
: MCStreamer(Context), ObjectWriter(TAB->createObjectWriter(OS)),
- TAB(std::move(TAB)), Assembler(llvm::make_unique<MCAssembler>(
- Context, *this->TAB, *Emitter_, *ObjectWriter)),
+ TAB(std::move(TAB)), Emitter(std::move(Emitter)),
+ Assembler(llvm::make_unique<MCAssembler>(Context, *this->TAB,
+ *this->Emitter, *ObjectWriter)),
EmitEHFrame(true), EmitDebugFrame(false) {}
-MCObjectStreamer::~MCObjectStreamer() {
- delete &Assembler->getEmitter();
-}
+MCObjectStreamer::~MCObjectStreamer() {}
void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) {
if (PendingLabels.empty())
Modified: llvm/trunk/lib/MC/MCWasmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCWasmStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCWasmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCWasmStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -202,9 +202,11 @@ void MCWasmStreamer::FinishImpl() {
MCStreamer *llvm::createWasmStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll) {
- MCWasmStreamer *S = new MCWasmStreamer(Context, std::move(MAB), OS, CE);
+ MCWasmStreamer *S =
+ new MCWasmStreamer(Context, std::move(MAB), OS, std::move(CE));
if (RelaxAll)
S->getAssembler().setRelaxAll(true);
return S;
Modified: llvm/trunk/lib/MC/MCWinCOFFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCWinCOFFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCWinCOFFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCWinCOFFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -43,8 +43,10 @@ using namespace llvm;
MCWinCOFFStreamer::MCWinCOFFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
- MCCodeEmitter &CE, raw_pwrite_stream &OS)
- : MCObjectStreamer(Context, std::move(MAB), OS, &CE), CurSymbol(nullptr) {}
+ std::unique_ptr<MCCodeEmitter> CE,
+ raw_pwrite_stream &OS)
+ : MCObjectStreamer(Context, std::move(MAB), OS, std::move(CE)),
+ CurSymbol(nullptr) {}
void MCWinCOFFStreamer::EmitInstToData(const MCInst &Inst,
const MCSubtargetInfo &STI) {
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -87,8 +87,9 @@ public:
friend class AArch64TargetELFStreamer;
AArch64ELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
- : MCELFStreamer(Context, std::move(TAB), OS, Emitter),
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)),
MappingSymbolCounter(0), LastEMS(EMS_None) {}
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override {
@@ -201,9 +202,10 @@ MCTargetStreamer *createAArch64AsmTarget
MCELFStreamer *createAArch64ELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll) {
AArch64ELFStreamer *S =
- new AArch64ELFStreamer(Context, std::move(TAB), OS, Emitter);
+ new AArch64ELFStreamer(Context, std::move(TAB), OS, std::move(Emitter));
if (RelaxAll)
S->getAssembler().setRelaxAll(true);
return S;
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h Wed Oct 11 16:34:47 2017
@@ -21,7 +21,8 @@ namespace llvm {
MCELFStreamer *createAArch64ELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll);
}
#endif
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -16,6 +16,8 @@
#include "AArch64MCAsmInfo.h"
#include "AArch64WinCOFFStreamer.h"
#include "InstPrinter/AArch64InstPrinter.h"
+#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
@@ -102,27 +104,31 @@ static MCInstPrinter *createAArch64MCIns
static MCStreamer *createELFStreamer(const Triple &T, MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
- return createAArch64ELFStreamer(Ctx, std::move(TAB), OS, Emitter, RelaxAll);
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
+ return createAArch64ELFStreamer(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll);
}
static MCStreamer *createMachOStreamer(MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll,
bool DWARFMustBeAtTheEnd) {
- return createMachOStreamer(Ctx, std::move(TAB), OS, Emitter, RelaxAll,
- DWARFMustBeAtTheEnd,
+ return createMachOStreamer(Ctx, std::move(TAB), OS, std::move(Emitter),
+ RelaxAll, DWARFMustBeAtTheEnd,
/*LabelSections*/ true);
}
-static MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
- std::unique_ptr<MCAsmBackend> &&TAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
- bool IncrementalLinkerCompatible) {
- return createAArch64WinCOFFStreamer(Ctx, std::move(TAB), OS, Emitter,
- RelaxAll, IncrementalLinkerCompatible);
+static MCStreamer *
+createWinCOFFStreamer(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
+ bool IncrementalLinkerCompatible) {
+ return createAArch64WinCOFFStreamer(Ctx, std::move(TAB), OS,
+ std::move(Emitter), RelaxAll,
+ IncrementalLinkerCompatible);
}
static MCInstrAnalysis *createAArch64InstrAnalysis(const MCInstrInfo *Info) {
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -8,6 +8,8 @@
//===----------------------------------------------------------------------===//
#include "AArch64WinCOFFStreamer.h"
+#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
using namespace llvm;
@@ -18,18 +20,19 @@ public:
friend class AArch64TargetWinCOFFStreamer;
AArch64WinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
- MCCodeEmitter &CE, raw_pwrite_stream &OS)
- : MCWinCOFFStreamer(C, std::move(AB), CE, OS) {}
+ std::unique_ptr<MCCodeEmitter> CE,
+ raw_pwrite_stream &OS)
+ : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), OS) {}
};
} // end anonymous namespace
namespace llvm {
-MCWinCOFFStreamer *
-createAArch64WinCOFFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
- bool RelaxAll, bool IncrementalLinkerCompatible) {
- auto *S = new AArch64WinCOFFStreamer(Context, std::move(MAB), *Emitter, OS);
+MCWinCOFFStreamer *createAArch64WinCOFFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll, bool IncrementalLinkerCompatible) {
+ auto *S = new AArch64WinCOFFStreamer(Context, std::move(MAB),
+ std::move(Emitter), OS);
S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
return S;
}
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h Wed Oct 11 16:34:47 2017
@@ -15,7 +15,6 @@
#define LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64WINCOFFSTREAMER_H
#include "AArch64TargetStreamer.h"
-#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCWinCOFFStreamer.h"
namespace {
@@ -34,11 +33,10 @@ public:
namespace llvm {
-MCWinCOFFStreamer *
-createAArch64WinCOFFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
- bool RelaxAll, bool IncrementalLinkerCompatible);
+MCWinCOFFStreamer *createAArch64WinCOFFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll, bool IncrementalLinkerCompatible);
} // end llvm namespace
#endif
Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -11,14 +11,15 @@
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
using namespace llvm;
AMDGPUELFStreamer::AMDGPUELFStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter)
- : MCELFStreamer(Context, std::move(MAB), OS, Emitter) {
+ std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCELFStreamer(Context, std::move(MAB), OS, std::move(Emitter)) {
unsigned Arch = ELF::EF_AMDGPU_ARCH_NONE;
switch (T.getArch()) {
case Triple::r600:
@@ -40,6 +41,8 @@ AMDGPUELFStreamer::AMDGPUELFStreamer(con
MCELFStreamer *llvm::createAMDGPUELFStreamer(
const Triple &T, MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll) {
- return new AMDGPUELFStreamer(T, Context, std::move(MAB), OS, Emitter);
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll) {
+ return new AMDGPUELFStreamer(T, Context, std::move(MAB), OS,
+ std::move(Emitter));
}
Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h Wed Oct 11 16:34:47 2017
@@ -27,13 +27,14 @@ class AMDGPUELFStreamer : public MCELFSt
public:
AMDGPUELFStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB, raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter);
+ std::unique_ptr<MCCodeEmitter> Emitter);
};
MCELFStreamer *createAMDGPUELFStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll);
} // namespace llvm.
#endif
Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -19,6 +19,7 @@
#include "InstPrinter/AMDGPUInstPrinter.h"
#include "SIDefines.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
@@ -81,9 +82,10 @@ static MCTargetStreamer * createAMDGPUOb
static MCStreamer *createMCStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
- return createAMDGPUELFStreamer(T, Context, std::move(MAB), OS, Emitter,
- RelaxAll);
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
+ return createAMDGPUELFStreamer(T, Context, std::move(MAB), OS,
+ std::move(Emitter), RelaxAll);
}
extern "C" void LLVMInitializeAMDGPUTargetMC() {
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -441,8 +441,10 @@ public:
friend class ARMTargetELFStreamer;
ARMELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool IsThumb)
- : MCELFStreamer(Context, std::move(TAB), OS, Emitter), IsThumb(IsThumb) {
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ bool IsThumb)
+ : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)),
+ IsThumb(IsThumb) {
EHReset();
}
@@ -1488,10 +1490,10 @@ MCTargetStreamer *createARMObjectTargetS
MCELFStreamer *createARMELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
- bool IsThumb) {
- ARMELFStreamer *S =
- new ARMELFStreamer(Context, std::move(TAB), OS, Emitter, IsThumb);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll, bool IsThumb) {
+ ARMELFStreamer *S = new ARMELFStreamer(Context, std::move(TAB), OS,
+ std::move(Emitter), IsThumb);
// FIXME: This should eventually end up somewhere else where more
// intelligent flag decisions can be made. For now we are just maintaining
// the status quo for ARM and setting EF_ARM_EABI_VER5 as the default.
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -17,6 +17,7 @@
#include "InstPrinter/ARMInstPrinter.h"
#include "llvm/ADT/Triple.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCELFStreamer.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
@@ -201,18 +202,19 @@ static MCAsmInfo *createARMMCAsmInfo(con
static MCStreamer *createELFStreamer(const Triple &T, MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
return createARMELFStreamer(
- Ctx, std::move(MAB), OS, Emitter, false,
+ Ctx, std::move(MAB), OS, std::move(Emitter), false,
(T.getArch() == Triple::thumb || T.getArch() == Triple::thumbeb));
}
-static MCStreamer *createARMMachOStreamer(MCContext &Ctx,
- std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
- bool DWARFMustBeAtTheEnd) {
- return createMachOStreamer(Ctx, std::move(MAB), OS, Emitter, false,
+static MCStreamer *
+createARMMachOStreamer(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&MAB,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
+ bool DWARFMustBeAtTheEnd) {
+ return createMachOStreamer(Ctx, std::move(MAB), OS, std::move(Emitter), false,
DWARFMustBeAtTheEnd);
}
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h Wed Oct 11 16:34:47 2017
@@ -96,7 +96,8 @@ MCAsmBackend *createThumbBEAsmBackend(co
MCStreamer *createARMWinCOFFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll,
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll,
bool IncrementalLinkerCompatible);
/// Construct an ELF Mach-O object writer.
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -9,6 +9,7 @@
#include "ARMMCTargetDesc.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCWinCOFFStreamer.h"
using namespace llvm;
@@ -17,8 +18,8 @@ namespace {
class ARMWinCOFFStreamer : public MCWinCOFFStreamer {
public:
ARMWinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
- MCCodeEmitter &CE, raw_pwrite_stream &OS)
- : MCWinCOFFStreamer(C, std::move(AB), CE, OS) {}
+ std::unique_ptr<MCCodeEmitter> CE, raw_pwrite_stream &OS)
+ : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), OS) {}
void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
void EmitThumbFunc(MCSymbol *Symbol) override;
@@ -38,13 +39,12 @@ void ARMWinCOFFStreamer::EmitThumbFunc(M
}
}
-MCStreamer *llvm::createARMWinCOFFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
- bool RelaxAll,
- bool IncrementalLinkerCompatible) {
- auto *S = new ARMWinCOFFStreamer(Context, std::move(MAB), *Emitter, OS);
+MCStreamer *llvm::createARMWinCOFFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll, bool IncrementalLinkerCompatible) {
+ auto *S =
+ new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(Emitter), OS);
S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
return S;
}
Modified: llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -52,8 +52,10 @@ static MCSubtargetInfo *createBPFMCSubta
static MCStreamer *createBPFMCStreamer(const Triple &T, MCContext &Ctx,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
- return createELFStreamer(Ctx, std::move(MAB), OS, Emitter, RelaxAll);
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
+ return createELFStreamer(Ctx, std::move(MAB), OS, std::move(Emitter),
+ RelaxAll);
}
static MCInstPrinter *createBPFMCInstPrinter(const Triple &T,
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -20,6 +20,7 @@
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
@@ -44,19 +45,17 @@ static cl::opt<unsigned> GPSize
cl::Prefix,
cl::init(8));
-HexagonMCELFStreamer::HexagonMCELFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter)
- : MCELFStreamer(Context, std::move(TAB), OS, Emitter),
+HexagonMCELFStreamer::HexagonMCELFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)),
MCII(createHexagonMCInstrInfo()) {}
-HexagonMCELFStreamer::HexagonMCELFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
- MCAssembler *Assembler)
- : MCELFStreamer(Context, std::move(TAB), OS, Emitter),
+HexagonMCELFStreamer::HexagonMCELFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ MCAssembler *Assembler)
+ : MCELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)),
MCII(createHexagonMCInstrInfo()) {}
void HexagonMCELFStreamer::EmitInstruction(const MCInst &MCB,
@@ -167,8 +166,9 @@ void HexagonMCELFStreamer::HexagonMCEmit
namespace llvm {
MCStreamer *createHexagonELFStreamer(Triple const &TT, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE) {
- return new HexagonMCELFStreamer(Context, std::move(MAB), OS, CE);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> CE) {
+ return new HexagonMCELFStreamer(Context, std::move(MAB), OS, std::move(CE));
}
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h Wed Oct 11 16:34:47 2017
@@ -23,10 +23,12 @@ class HexagonMCELFStreamer : public MCEL
public:
HexagonMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter);
HexagonMCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter,
MCAssembler *Assembler);
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
@@ -41,7 +43,8 @@ public:
MCStreamer *createHexagonELFStreamer(Triple const &TT, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> CE);
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -21,6 +21,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCELFStreamer.h"
@@ -228,8 +229,10 @@ createMCAsmTargetStreamer(MCStreamer &S,
static MCStreamer *createMCStreamer(Triple const &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
- return createHexagonELFStreamer(T, Context, std::move(MAB), OS, Emitter);
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
+ return createHexagonELFStreamer(T, Context, std::move(MAB), OS,
+ std::move(Emitter));
}
static MCTargetStreamer *
Modified: llvm/trunk/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -62,11 +62,13 @@ createLanaiMCSubtargetInfo(const Triple
static MCStreamer *createMCStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
if (!T.isOSBinFormatELF())
llvm_unreachable("OS not supported");
- return createELFStreamer(Context, std::move(MAB), OS, Emitter, RelaxAll);
+ return createELFStreamer(Context, std::move(MAB), OS, std::move(Emitter),
+ RelaxAll);
}
static MCInstPrinter *createLanaiMCInstPrinter(const Triple & /*T*/,
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -13,6 +13,7 @@
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSymbolELF.h"
@@ -22,8 +23,9 @@ using namespace llvm;
MipsELFStreamer::MipsELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
- : MCELFStreamer(Context, std::move(MAB), OS, Emitter) {
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter)
+ : MCELFStreamer(Context, std::move(MAB), OS, std::move(Emitter)) {
RegInfoRecord = new MipsRegInfoRecord(this, Context);
MipsOptionRecords.push_back(
std::unique_ptr<MipsRegInfoRecord>(RegInfoRecord));
@@ -87,10 +89,9 @@ void MipsELFStreamer::EmitMipsOptionReco
I->EmitMipsOptionRecord();
}
-MCELFStreamer *llvm::createMipsELFStreamer(MCContext &Context,
- std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
- bool RelaxAll) {
- return new MipsELFStreamer(Context, std::move(MAB), OS, Emitter);
+MCELFStreamer *llvm::createMipsELFStreamer(
+ MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll) {
+ return new MipsELFStreamer(Context, std::move(MAB), OS, std::move(Emitter));
}
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h Wed Oct 11 16:34:47 2017
@@ -34,7 +34,8 @@ class MipsELFStreamer : public MCELFStre
public:
MipsELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter);
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter);
/// Overriding this function allows us to add arbitrary behaviour before the
/// \p Inst is actually emitted. For example, we can inspect the operands and
@@ -67,7 +68,8 @@ public:
MCELFStreamer *createMipsELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll);
} // end namespace llvm
#endif // LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSELFSTREAMER_H
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h Wed Oct 11 16:34:47 2017
@@ -25,7 +25,8 @@ bool baseRegNeedsLoadStoreMask(unsigned
MCELFStreamer *createMipsNaClELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll);
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ bool RelaxAll);
}
#endif
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp Wed Oct 11 16:34:47 2017
@@ -19,6 +19,7 @@
#include "MipsMCNaCl.h"
#include "MipsTargetStreamer.h"
#include "llvm/ADT/Triple.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCELFStreamer.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
@@ -93,13 +94,15 @@ static MCInstPrinter *createMipsMCInstPr
static MCStreamer *createMCStreamer(const Triple &T, MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
MCStreamer *S;
if (!T.isOSNaCl())
- S = createMipsELFStreamer(Context, std::move(MAB), OS, Emitter, RelaxAll);
+ S = createMipsELFStreamer(Context, std::move(MAB), OS, std::move(Emitter),
+ RelaxAll);
else
- S = createMipsNaClELFStreamer(Context, std::move(MAB), OS, Emitter,
- RelaxAll);
+ S = createMipsNaClELFStreamer(Context, std::move(MAB), OS,
+ std::move(Emitter), RelaxAll);
return S;
}
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -22,6 +22,7 @@
#include "MipsMCNaCl.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCELFStreamer.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/ErrorHandling.h"
@@ -42,8 +43,9 @@ const unsigned LoadStoreStackMaskReg = M
class MipsNaClELFStreamer : public MipsELFStreamer {
public:
MipsNaClELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter)
- : MipsELFStreamer(Context, std::move(TAB), OS, Emitter) {}
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> Emitter)
+ : MipsELFStreamer(Context, std::move(TAB), OS, std::move(Emitter)) {}
~MipsNaClELFStreamer() override = default;
@@ -259,10 +261,10 @@ bool baseRegNeedsLoadStoreMask(unsigned
MCELFStreamer *createMipsNaClELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter,
+ std::unique_ptr<MCCodeEmitter> Emitter,
bool RelaxAll) {
MipsNaClELFStreamer *S =
- new MipsNaClELFStreamer(Context, std::move(TAB), OS, Emitter);
+ new MipsNaClELFStreamer(Context, std::move(TAB), OS, std::move(Emitter));
if (RelaxAll)
S->getAssembler().setRelaxAll(true);
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h Wed Oct 11 16:34:47 2017
@@ -93,7 +93,8 @@ MCTargetStreamer *createX86ObjectTargetS
/// Takes ownership of \p AB and \p CE.
MCStreamer *createX86WinCOFFStreamer(MCContext &C,
std::unique_ptr<MCAsmBackend> &&AB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll,
bool IncrementalLinkerCompatible);
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp Wed Oct 11 16:34:47 2017
@@ -10,6 +10,7 @@
#include "X86MCTargetDesc.h"
#include "X86TargetStreamer.h"
#include "llvm/MC/MCAsmBackend.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCWin64EH.h"
#include "llvm/MC/MCWinCOFFStreamer.h"
@@ -20,8 +21,8 @@ class X86WinCOFFStreamer : public MCWinC
Win64EH::UnwindEmitter EHStreamer;
public:
X86WinCOFFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> AB,
- MCCodeEmitter *CE, raw_pwrite_stream &OS)
- : MCWinCOFFStreamer(C, std::move(AB), *CE, OS) {}
+ std::unique_ptr<MCCodeEmitter> CE, raw_pwrite_stream &OS)
+ : MCWinCOFFStreamer(C, std::move(AB), std::move(CE), OS) {}
void EmitWinEHHandlerData(SMLoc Loc) override;
void EmitWindowsUnwindTables() override;
@@ -60,9 +61,11 @@ void X86WinCOFFStreamer::FinishImpl() {
MCStreamer *llvm::createX86WinCOFFStreamer(MCContext &C,
std::unique_ptr<MCAsmBackend> &&AB,
raw_pwrite_stream &OS,
- MCCodeEmitter *CE, bool RelaxAll,
+ std::unique_ptr<MCCodeEmitter> &&CE,
+ bool RelaxAll,
bool IncrementalLinkerCompatible) {
- X86WinCOFFStreamer *S = new X86WinCOFFStreamer(C, std::move(AB), CE, OS);
+ X86WinCOFFStreamer *S =
+ new X86WinCOFFStreamer(C, std::move(AB), std::move(CE), OS);
S->getAssembler().setRelaxAll(RelaxAll);
S->getAssembler().setIncrementalLinkerCompatible(IncrementalLinkerCompatible);
return S;
Modified: llvm/trunk/tools/dsymutil/DwarfLinker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/DwarfLinker.cpp (original)
+++ llvm/trunk/tools/dsymutil/DwarfLinker.cpp Wed Oct 11 16:34:47 2017
@@ -623,8 +623,9 @@ bool DwarfStreamer::init(Triple TheTripl
MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
MS = TheTarget->createMCObjectStreamer(
- TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), *OutFile, MCE, *MSTI,
- MCOptions.MCRelaxAll, MCOptions.MCIncrementalLinkerCompatible,
+ TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), *OutFile,
+ std::unique_ptr<MCCodeEmitter>(MCE), *MSTI, MCOptions.MCRelaxAll,
+ MCOptions.MCIncrementalLinkerCompatible,
/*DWARFMustBeAtTheEnd*/ false);
if (!MS)
return error("no object streamer for target " + TripleName, Context);
Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Wed Oct 11 16:34:47 2017
@@ -22,6 +22,7 @@
#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.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/MCObjectFileInfo.h"
@@ -707,8 +708,9 @@ int main(int argc, char **argv) {
MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
std::unique_ptr<MCStreamer> MS(TheTarget->createMCObjectStreamer(
- TheTriple, MC, std::unique_ptr<MCAsmBackend>(MAB), OutFile, MCE, *MSTI,
- MCOptions.MCRelaxAll, MCOptions.MCIncrementalLinkerCompatible,
+ TheTriple, MC, std::unique_ptr<MCAsmBackend>(MAB), OutFile,
+ std::unique_ptr<MCCodeEmitter>(MCE), *MSTI, MCOptions.MCRelaxAll,
+ MCOptions.MCIncrementalLinkerCompatible,
/*DWARFMustBeAtTheEnd*/ false));
if (!MS)
return error("no object streamer for target " + TripleName, Context);
Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Wed Oct 11 16:34:47 2017
@@ -15,6 +15,7 @@
#include "Disassembler.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrInfo.h"
@@ -591,8 +592,9 @@ int main(int argc, char **argv) {
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU,
MCOptions);
Str.reset(TheTarget->createMCObjectStreamer(
- TheTriple, Ctx, std::unique_ptr<MCAsmBackend>(MAB), *OS, CE, *STI,
- MCOptions.MCRelaxAll, MCOptions.MCIncrementalLinkerCompatible,
+ TheTriple, Ctx, std::unique_ptr<MCAsmBackend>(MAB), *OS,
+ std::unique_ptr<MCCodeEmitter>(CE), *STI, MCOptions.MCRelaxAll,
+ MCOptions.MCIncrementalLinkerCompatible,
/*DWARFMustBeAtTheEnd*/ false));
if (NoExecStack)
Str->InitSections(true);
Modified: llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp?rev=315531&r1=315530&r2=315531&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp Wed Oct 11 16:34:47 2017
@@ -181,8 +181,9 @@ llvm::Error dwarfgen::Generator::init(Tr
MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
MS = TheTarget->createMCObjectStreamer(
- TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), *Stream, MCE, *MSTI,
- MCOptions.MCRelaxAll, MCOptions.MCIncrementalLinkerCompatible,
+ TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), *Stream,
+ std::unique_ptr<MCCodeEmitter>(MCE), *MSTI, MCOptions.MCRelaxAll,
+ MCOptions.MCIncrementalLinkerCompatible,
/*DWARFMustBeAtTheEnd*/ false);
if (!MS)
return make_error<StringError>("no object streamer for target " +
More information about the llvm-commits
mailing list