diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -1192,14 +1192,14 @@ /*PIC=*/!HasFixedLoadAddress)); MCEInstance.LocalCtx->setObjectFileInfo(MCEInstance.LocalMOFI.get()); MCEInstance.MCE.reset( - TheTarget->createMCCodeEmitter(*MII, *MRI, *MCEInstance.LocalCtx)); + TheTarget->createMCCodeEmitter(*MII, *MCEInstance.LocalCtx)); return MCEInstance; } /// Creating MCStreamer instance. std::unique_ptr createStreamer(llvm::raw_pwrite_stream &OS) const { - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr OW = MAB->createObjectWriter(OS); diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -223,7 +223,7 @@ InstructionPrinter->setPrintImmHex(true); std::unique_ptr MCE( - TheTarget->createMCCodeEmitter(*MII, *MRI, *Ctx)); + TheTarget->createMCCodeEmitter(*MII, *Ctx)); // Make sure we don't miss any output on core dumps. outs().SetUnbuffered(); diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -455,7 +455,7 @@ std::unique_ptr CE; if (Opts.ShowEncoding) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -475,7 +475,7 @@ } std::unique_ptr CE( - TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); assert(MAB && "Unable to create asm backend!"); diff --git a/llvm/include/llvm/MC/TargetRegistry.h b/llvm/include/llvm/MC/TargetRegistry.h --- a/llvm/include/llvm/MC/TargetRegistry.h +++ b/llvm/include/llvm/MC/TargetRegistry.h @@ -175,7 +175,6 @@ const MCInstrInfo &MII, const MCRegisterInfo &MRI); using MCCodeEmitterCtorTy = MCCodeEmitter *(*)(const MCInstrInfo &II, - const MCRegisterInfo &MRI, MCContext &Ctx); using ELFStreamerCtorTy = MCStreamer *(*)(const Triple &T, MCContext &Ctx, @@ -506,11 +505,10 @@ /// createMCCodeEmitter - Create a target specific code emitter. MCCodeEmitter *createMCCodeEmitter(const MCInstrInfo &II, - const MCRegisterInfo &MRI, MCContext &Ctx) const { if (!MCCodeEmitterCtorFn) return nullptr; - return MCCodeEmitterCtorFn(II, MRI, Ctx); + return MCCodeEmitterCtorFn(II, Ctx); } /// Create a target specific MCStreamer. @@ -1360,7 +1358,6 @@ private: static MCCodeEmitter *Allocator(const MCInstrInfo & /*II*/, - const MCRegisterInfo & /*MRI*/, MCContext & /*Ctx*/) { return new MCCodeEmitterImpl(); } diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -165,7 +165,7 @@ // Create a code emitter if asked to show the encoding. std::unique_ptr MCE; if (Options.MCOptions.ShowMCEncoding) - MCE.reset(getTarget().createMCCodeEmitter(MII, MRI, Context)); + MCE.reset(getTarget().createMCCodeEmitter(MII, Context)); std::unique_ptr MAB( getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions)); @@ -180,7 +180,7 @@ case CGFT_ObjectFile: { // Create the code emitter for the target if it exists. If not, .o file // emission fails. - MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(MII, MRI, Context); + MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(MII, Context); if (!MCE) return make_error("createMCCodeEmitter failed", inconvertibleErrorCode()); @@ -260,8 +260,7 @@ // emission fails. const MCSubtargetInfo &STI = *getMCSubtargetInfo(); const MCRegisterInfo &MRI = *getMCRegisterInfo(); - MCCodeEmitter *MCE = - getTarget().createMCCodeEmitter(*getMCInstrInfo(), MRI, *Ctx); + MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(*getMCInstrInfo(), *Ctx); MCAsmBackend *MAB = getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions); if (!MCE || !MAB) diff --git a/llvm/lib/DWARFLinker/DWARFStreamer.cpp b/llvm/lib/DWARFLinker/DWARFStreamer.cpp --- a/llvm/lib/DWARFLinker/DWARFStreamer.cpp +++ b/llvm/lib/DWARFLinker/DWARFStreamer.cpp @@ -68,7 +68,7 @@ if (!MII) return error("no instr info info for target " + TripleName, Context), false; - MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *MC); + MCE = TheTarget->createMCCodeEmitter(*MII, *MC); if (!MCE) return error("no code emitter for target " + TripleName, Context), false; diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp --- a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp +++ b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp @@ -304,7 +304,6 @@ llvm::MCCodeEmitter * llvm::createLanaiMCCodeEmitter(const MCInstrInfo &InstrInfo, - const MCRegisterInfo & /*MRI*/, MCContext &context) { return new LanaiMCCodeEmitter(InstrInfo, context); } diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp @@ -94,7 +94,6 @@ } // end anonymous namespace MCCodeEmitter *llvm::createRISCVMCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx) { return new RISCVMCCodeEmitter(Ctx, MCII); } diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h @@ -29,7 +29,6 @@ class Target; MCCodeEmitter *createRISCVMCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx); MCAsmBackend *createRISCVAsmBackend(const Target &T, const MCSubtargetInfo &STI, diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp @@ -1843,7 +1843,6 @@ } MCCodeEmitter *llvm::createX86MCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx) { return new X86MCCodeEmitter(MCII, Ctx); } diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h @@ -70,7 +70,6 @@ } MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx); MCAsmBackend *createX86_32AsmBackend(const Target &T, diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -60,8 +60,7 @@ SMShadowTracker.startFunction(MF); CodeEmitter.reset(TM.getTarget().createMCCodeEmitter( - *Subtarget->getInstrInfo(), *Subtarget->getRegisterInfo(), - MF.getContext())); + *Subtarget->getInstrInfo(), MF.getContext())); EmitFPOData = Subtarget->isTargetWin32() && MF.getMMI().getModule()->getCodeViewFlag(); diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -165,7 +165,7 @@ if (!MII) return error("no instr info info for target " + TripleName, Context); - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, MC); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, MC); if (!MCE) return error("no code emitter for target " + TripleName, Context); diff --git a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp --- a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp +++ b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp @@ -67,8 +67,7 @@ TheTargetMachine->getMCSubtargetInfo()); std::unique_ptr CodeEmitter( TheTargetMachine->getTarget().createMCCodeEmitter( - *TheTargetMachine->getMCInstrInfo(), *TheTargetMachine->getMCRegisterInfo(), - Context)); + *TheTargetMachine->getMCInstrInfo(), Context)); assert(CodeEmitter && "unable to create code emitter"); SmallVector Tmp; raw_svector_ostream OS(Tmp); diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp --- a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -229,7 +229,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr(MAB), diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -541,7 +541,7 @@ // Set up the AsmStreamer. std::unique_ptr CE; if (ShowEncoding) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -561,7 +561,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr(MAB), diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -479,7 +479,7 @@ unsigned RegionIdx = 0; std::unique_ptr MCE( - TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + TheTarget->createMCCodeEmitter(*MCII, Ctx)); assert(MCE && "Unable to create code emitter!"); std::unique_ptr MAB(TheTarget->createMCAsmBackend( diff --git a/llvm/tools/llvm-ml/llvm-ml.cpp b/llvm/tools/llvm-ml/llvm-ml.cpp --- a/llvm/tools/llvm-ml/llvm-ml.cpp +++ b/llvm/tools/llvm-ml/llvm-ml.cpp @@ -377,7 +377,7 @@ // Set up the AsmStreamer. std::unique_ptr CE; if (InputArgs.hasArg(OPT_show_encoding)) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -395,7 +395,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr(MAB), diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp --- a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp @@ -106,7 +106,7 @@ Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Res.MII.reset(TheTarget->createMCInstrInfo()); - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *MRI, *Res.Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *Res.Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr OW = MAB->createObjectWriter(OS); diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -464,7 +464,7 @@ TLOF->Initialize(*MC, *TM); MC->setObjectFileInfo(TLOF); - MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *MC); + MCE = TheTarget->createMCCodeEmitter(*MII, *MC); if (!MCE) return make_error("no code emitter for target " + TripleName, inconvertibleErrorCode()); diff --git a/llvm/unittests/MC/DwarfLineTableHeaders.cpp b/llvm/unittests/MC/DwarfLineTableHeaders.cpp --- a/llvm/unittests/MC/DwarfLineTableHeaders.cpp +++ b/llvm/unittests/MC/DwarfLineTableHeaders.cpp @@ -77,8 +77,7 @@ Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Res.MII.reset(TheTarget->createMCInstrInfo()); - MCCodeEmitter *MCE = - TheTarget->createMCCodeEmitter(*Res.MII, *MRI, *Res.Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *Res.Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr OW = MAB->createObjectWriter(OS); diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp --- a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -377,7 +377,7 @@ std::unique_ptr mcStreamer; std::unique_ptr mcii(target->createMCInstrInfo()); - llvm::MCCodeEmitter *ce = target->createMCCodeEmitter(*mcii, *mri, ctx); + llvm::MCCodeEmitter *ce = target->createMCCodeEmitter(*mcii, ctx); llvm::MCAsmBackend *mab = target->createMCAsmBackend(*sti, *mri, mcOptions); mcStreamer.reset(target->createMCObjectStreamer( triple, ctx, std::unique_ptr(mab),