mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 05:32:25 +00:00
Replace the MCSubtargetInfo parameter with a Triple when creating
an MCInstPrinter. Update all callers and use where we wanted a Triple previously. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233648 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6dd9e8563b
commit
e2424b02b2
@ -124,11 +124,11 @@ namespace llvm {
|
||||
typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T,
|
||||
const MCSubtargetInfo &STI,
|
||||
MCContext &Ctx);
|
||||
typedef MCInstPrinter *(*MCInstPrinterCtorTy)(unsigned SyntaxVariant,
|
||||
typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI);
|
||||
const MCRegisterInfo &MRI);
|
||||
typedef MCCodeEmitter *(*MCCodeEmitterCtorTy)(const MCInstrInfo &II,
|
||||
const MCRegisterInfo &MRI,
|
||||
MCContext &Ctx);
|
||||
@ -408,14 +408,13 @@ namespace llvm {
|
||||
return MCDisassemblerCtorFn(*this, STI, Ctx);
|
||||
}
|
||||
|
||||
MCInstPrinter *createMCInstPrinter(unsigned SyntaxVariant,
|
||||
MCInstPrinter *createMCInstPrinter(const Triple &T, unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) const {
|
||||
const MCRegisterInfo &MRI) const {
|
||||
if (!MCInstPrinterCtorFn)
|
||||
return nullptr;
|
||||
return MCInstPrinterCtorFn(SyntaxVariant, MAI, MII, MRI, STI);
|
||||
return MCInstPrinterCtorFn(T, SyntaxVariant, MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
||||
|
@ -175,7 +175,7 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
||||
switch (FileType) {
|
||||
case CGFT_AssemblyFile: {
|
||||
MCInstPrinter *InstPrinter = getTarget().createMCInstPrinter(
|
||||
MAI.getAssemblerDialect(), MAI, MII, MRI, STI);
|
||||
Triple(getTargetTriple()), MAI.getAssemblerDialect(), MAI, MII, MRI);
|
||||
|
||||
// Create a code emitter if asked to show the encoding.
|
||||
MCCodeEmitter *MCE = nullptr;
|
||||
|
@ -82,8 +82,8 @@ LLVMCreateDisasmCPUFeatures(const char *TT, const char *CPU,
|
||||
|
||||
// Set up the instruction printer.
|
||||
int AsmPrinterVariant = MAI->getAssemblerDialect();
|
||||
MCInstPrinter *IP = TheTarget->createMCInstPrinter(AsmPrinterVariant,
|
||||
*MAI, *MII, *MRI, *STI);
|
||||
MCInstPrinter *IP = TheTarget->createMCInstPrinter(
|
||||
Triple(TT), AsmPrinterVariant, *MAI, *MII, *MRI);
|
||||
if (!IP)
|
||||
return nullptr;
|
||||
|
||||
@ -311,11 +311,10 @@ int LLVMSetDisasmOptions(LLVMDisasmContextRef DCR, uint64_t Options){
|
||||
const MCAsmInfo *MAI = DC->getAsmInfo();
|
||||
const MCInstrInfo *MII = DC->getInstrInfo();
|
||||
const MCRegisterInfo *MRI = DC->getRegisterInfo();
|
||||
const MCSubtargetInfo *STI = DC->getSubtargetInfo();
|
||||
int AsmPrinterVariant = MAI->getAssemblerDialect();
|
||||
AsmPrinterVariant = AsmPrinterVariant == 0 ? 1 : 0;
|
||||
MCInstPrinter *IP = DC->getTarget()->createMCInstPrinter(
|
||||
AsmPrinterVariant, *MAI, *MII, *MRI, *STI);
|
||||
Triple(DC->getTripleName()), AsmPrinterVariant, *MAI, *MII, *MRI);
|
||||
if (IP) {
|
||||
DC->setIP(IP);
|
||||
DC->addOptions(LLVMDisassembler_Option_AsmPrinterVariant);
|
||||
|
@ -109,11 +109,11 @@ static MCCodeGenInfo *createAArch64MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createAArch64MCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createAArch64MCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new AArch64InstPrinter(MAI, MII, MRI);
|
||||
if (SyntaxVariant == 1)
|
||||
|
@ -323,11 +323,11 @@ static MCStreamer *createARMMachOStreamer(MCContext &Ctx, MCAsmBackend &MAB,
|
||||
return createMachOStreamer(Ctx, MAB, OS, Emitter, false, DWARFMustBeAtTheEnd);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createARMMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createARMMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new ARMInstPrinter(MAI, MII, MRI);
|
||||
return nullptr;
|
||||
|
@ -68,11 +68,11 @@ static MCStreamer *createBPFMCStreamer(const Triple &T,
|
||||
return createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createBPFMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createBPFMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new BPFInstPrinter(MAI, MII, MRI);
|
||||
return 0;
|
||||
|
@ -222,11 +222,11 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
return;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createHexagonMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createHexagonMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return(new HexagonInstPrinter(MAI, MII, MRI));
|
||||
else
|
||||
|
@ -75,11 +75,11 @@ static MCCodeGenInfo *createHexagonMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
X->InitMCCodeGenInfo(Reloc::Static, CM, OL);
|
||||
return X;
|
||||
}
|
||||
static MCInstPrinter *createHexagonMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createHexagonMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new HexagonInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ static MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createMSP430MCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createMSP430MCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new MSP430InstPrinter(MAI, MII, MRI);
|
||||
return nullptr;
|
||||
|
@ -97,11 +97,11 @@ static MCCodeGenInfo *createMipsMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createMipsMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createMipsMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new MipsInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ static MCCodeGenInfo *createNVPTXMCCodeGenInfo(
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createNVPTXMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createNVPTXMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new NVPTXInstPrinter(MAI, MII, MRI);
|
||||
return nullptr;
|
||||
|
@ -238,13 +238,12 @@ createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
|
||||
return new PPCTargetMachOStreamer(S);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createPPCMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createPPCMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
bool isDarwin = Triple(STI.getTargetTriple()).isOSDarwin();
|
||||
return new PPCInstPrinter(MAI, MII, MRI, isDarwin);
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new PPCInstPrinter(MAI, MII, MRI, T.isOSDarwin());
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializePowerPCTargetMC() {
|
||||
|
@ -64,11 +64,11 @@ static MCCodeGenInfo *createAMDGPUMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createAMDGPUMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createAMDGPUMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new AMDGPUInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -134,11 +134,11 @@ static MCTargetStreamer *createTargetAsmStreamer(MCStreamer &S,
|
||||
return new SparcTargetAsmStreamer(S, OS);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createSparcMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createSparcMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new SparcInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -172,11 +172,11 @@ static MCCodeGenInfo *createSystemZMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createSystemZMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createSystemZMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new SystemZInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -207,11 +207,11 @@ static MCCodeGenInfo *createX86MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createX86MCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createX86MCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new X86ATTInstPrinter(MAI, MII, MRI);
|
||||
if (SyntaxVariant == 1)
|
||||
|
@ -81,11 +81,11 @@ static MCCodeGenInfo *createXCoreMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createXCoreMCInstPrinter(unsigned SyntaxVariant,
|
||||
static MCInstPrinter *createXCoreMCInstPrinter(const Triple &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
const MCInstrInfo &MII,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const MCRegisterInfo &MRI) {
|
||||
return new XCoreInstPrinter(MAI, MII, MRI);
|
||||
}
|
||||
|
||||
|
@ -448,8 +448,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
MCInstPrinter *IP = nullptr;
|
||||
if (FileType == OFT_AssemblyFile) {
|
||||
IP =
|
||||
TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *MCII, *MRI, *STI);
|
||||
IP = TheTarget->createMCInstPrinter(Triple(TripleName), OutputAsmVariant,
|
||||
*MAI, *MCII, *MRI);
|
||||
|
||||
// Set the display preference for hex vs. decimal immediates.
|
||||
IP->setPrintImmHex(PrintImmHex);
|
||||
|
@ -3032,7 +3032,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
|
||||
}
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
|
||||
AsmPrinterVariant, *AsmInfo, *InstrInfo, *MRI, *STI));
|
||||
Triple(TripleName), AsmPrinterVariant, *AsmInfo, *InstrInfo, *MRI));
|
||||
// Set the display preference for hex vs. decimal immediates.
|
||||
IP->setPrintImmHex(PrintImmHex);
|
||||
// Comment stream and backing vector.
|
||||
@ -3080,8 +3080,8 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
|
||||
}
|
||||
int ThumbAsmPrinterVariant = ThumbAsmInfo->getAssemblerDialect();
|
||||
ThumbIP.reset(ThumbTarget->createMCInstPrinter(
|
||||
ThumbAsmPrinterVariant, *ThumbAsmInfo, *ThumbInstrInfo, *ThumbMRI,
|
||||
*ThumbSTI));
|
||||
Triple(ThumbTripleName), ThumbAsmPrinterVariant, *ThumbAsmInfo,
|
||||
*ThumbInstrInfo, *ThumbMRI));
|
||||
// Set the display preference for hex vs. decimal immediates.
|
||||
ThumbIP->setPrintImmHex(PrintImmHex);
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
|
||||
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
|
||||
AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
|
||||
Triple(TripleName), AsmPrinterVariant, *AsmInfo, *MII, *MRI));
|
||||
if (!IP) {
|
||||
errs() << "error: no instruction printer for target " << TripleName
|
||||
<< '\n';
|
||||
|
@ -507,7 +507,7 @@ static int linkAndVerify() {
|
||||
std::unique_ptr<MCInstrInfo> MII(TheTarget->createMCInstrInfo());
|
||||
|
||||
std::unique_ptr<MCInstPrinter> InstPrinter(
|
||||
TheTarget->createMCInstPrinter(0, *MAI, *MII, *MRI, *STI));
|
||||
TheTarget->createMCInstPrinter(Triple(TripleName), 0, *MAI, *MII, *MRI));
|
||||
|
||||
// Load any dylibs requested on the command line.
|
||||
loadDylibs();
|
||||
|
Loading…
Reference in New Issue
Block a user