LLVM API Documentation
00001 //===-- SparcInstPrinter.h - Convert Sparc MCInst to assembly syntax ------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This class prints an Sparc MCInst to a .s file. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H 00015 #define LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H 00016 00017 #include "llvm/MC/MCInstPrinter.h" 00018 #include "llvm/MC/MCSubtargetInfo.h" 00019 00020 namespace llvm { 00021 00022 class MCOperand; 00023 00024 class SparcInstPrinter : public MCInstPrinter { 00025 const MCSubtargetInfo &STI; 00026 public: 00027 SparcInstPrinter(const MCAsmInfo &MAI, 00028 const MCInstrInfo &MII, 00029 const MCRegisterInfo &MRI, 00030 const MCSubtargetInfo &sti) 00031 : MCInstPrinter(MAI, MII, MRI), STI(sti) {} 00032 00033 void printRegName(raw_ostream &OS, unsigned RegNo) const override; 00034 void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override; 00035 bool printSparcAliasInstr(const MCInst *MI, raw_ostream &OS); 00036 bool isV9() const; 00037 00038 // Autogenerated by tblgen. 00039 void printInstruction(const MCInst *MI, raw_ostream &O); 00040 bool printAliasInstr(const MCInst *MI, raw_ostream &O); 00041 void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx, 00042 unsigned PrintMethodIdx, raw_ostream &O); 00043 static const char *getRegisterName(unsigned RegNo); 00044 00045 void printOperand(const MCInst *MI, int opNum, raw_ostream &OS); 00046 void printMemOperand(const MCInst *MI, int opNum, raw_ostream &OS, 00047 const char *Modifier = nullptr); 00048 void printCCOperand(const MCInst *MI, int opNum, raw_ostream &OS); 00049 bool printGetPCX(const MCInst *MI, unsigned OpNo, raw_ostream &OS); 00050 00051 }; 00052 } // end namespace llvm 00053 00054 #endif