mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Move getOpcodeName from the various target InstPrinters into the superclass MCInstPrinter.
All implementations used the same code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153866 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fab3f7ee6f
commit
c97ef618d2
@ -52,7 +52,7 @@ public:
|
||||
|
||||
/// getOpcodeName - Return the name of the specified opcode enum (e.g.
|
||||
/// "MOV32ri") or empty if we can't resolve it.
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
StringRef getOpcodeName(unsigned Opcode) const;
|
||||
|
||||
/// printRegName - Print the assembler register name.
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
|
@ -8,6 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCInstPrinter.h"
|
||||
#include "llvm/MC/MCInstrInfo.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@ -20,7 +21,7 @@ MCInstPrinter::~MCInstPrinter() {
|
||||
/// getOpcodeName - Return the name of the specified opcode enum (e.g.
|
||||
/// "MOV32ri") or empty if we can't resolve it.
|
||||
StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return "";
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
|
||||
|
@ -44,10 +44,6 @@ ARMInstPrinter::ARMInstPrinter(const MCAsmInfo &MAI,
|
||||
setAvailableFeatures(STI.getFeatureBits());
|
||||
}
|
||||
|
||||
StringRef ARMInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void ARMInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
|
||||
OS << getRegisterName(RegNo);
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ public:
|
||||
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
|
||||
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
|
||||
// Autogenerated by tblgen.
|
||||
|
@ -62,10 +62,6 @@ const char* Mips::MipsFCCToString(Mips::CondCode CC) {
|
||||
llvm_unreachable("Impossible condition code!");
|
||||
}
|
||||
|
||||
StringRef MipsInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void MipsInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
|
||||
OS << '$' << StringRef(getRegisterName(RegNo)).lower();
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public:
|
||||
void printInstruction(const MCInst *MI, raw_ostream &O);
|
||||
static const char *getRegisterName(unsigned RegNo);
|
||||
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
||||
|
||||
|
@ -36,10 +36,6 @@ PTXInstPrinter::PTXInstPrinter(const MCAsmInfo &MAI,
|
||||
setAvailableFeatures(STI.getFeatureBits());
|
||||
}
|
||||
|
||||
StringRef PTXInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void PTXInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
|
||||
// Decode the register number into type and offset
|
||||
unsigned RegSpace = RegNo & 0x7;
|
||||
|
@ -27,7 +27,6 @@ public:
|
||||
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
|
||||
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
|
||||
// Autogenerated by tblgen.
|
||||
|
@ -23,10 +23,6 @@ using namespace llvm;
|
||||
|
||||
#include "PPCGenAsmWriter.inc"
|
||||
|
||||
StringRef PPCInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void PPCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
|
||||
OS << getRegisterName(RegNo);
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
|
||||
// Autogenerated by tblgen.
|
||||
void printInstruction(const MCInst *MI, raw_ostream &O);
|
||||
|
@ -50,10 +50,6 @@ void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
|
||||
EmitAnyX86InstComments(MI, *CommentStream, getRegisterName);
|
||||
}
|
||||
|
||||
StringRef X86ATTInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
switch (MI->getOperand(Op).getImm()) {
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot);
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
|
||||
// Autogenerated by tblgen, returns true if we successfully printed an
|
||||
// alias.
|
||||
|
@ -41,9 +41,6 @@ void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
|
||||
if (CommentStream)
|
||||
EmitAnyX86InstComments(MI, *CommentStream, getRegisterName);
|
||||
}
|
||||
StringRef X86IntelInstPrinter::getOpcodeName(unsigned Opcode) const {
|
||||
return MII.getName(Opcode);
|
||||
}
|
||||
|
||||
void X86IntelInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot);
|
||||
virtual StringRef getOpcodeName(unsigned Opcode) const;
|
||||
|
||||
// Autogenerated by tblgen.
|
||||
void printInstruction(const MCInst *MI, raw_ostream &O);
|
||||
|
Loading…
x
Reference in New Issue
Block a user