LLVM API Documentation

PPCInstPrinter.h
Go to the documentation of this file.
00001 //===- PPCInstPrinter.h - Convert PPC MCInst to assembly syntax -*- C++ -*-===//
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 PPC MCInst to a .s file.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_POWERPC_INSTPRINTER_PPCINSTPRINTER_H
00015 #define LLVM_LIB_TARGET_POWERPC_INSTPRINTER_PPCINSTPRINTER_H
00016 
00017 #include "llvm/MC/MCInstPrinter.h"
00018 
00019 namespace llvm {
00020 
00021 class MCOperand;
00022 
00023 class PPCInstPrinter : public MCInstPrinter {
00024   bool IsDarwin;
00025 public:
00026   PPCInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
00027                  const MCRegisterInfo &MRI, bool isDarwin)
00028     : MCInstPrinter(MAI, MII, MRI), IsDarwin(isDarwin) {}
00029   
00030   bool isDarwinSyntax() const {
00031     return IsDarwin;
00032   }
00033   
00034   void printRegName(raw_ostream &OS, unsigned RegNo) const override;
00035   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override;
00036   
00037   // Autogenerated by tblgen.
00038   void printInstruction(const MCInst *MI, raw_ostream &O);
00039   static const char *getRegisterName(unsigned RegNo);
00040   
00041 
00042   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00043   void printPredicateOperand(const MCInst *MI, unsigned OpNo,
00044                              raw_ostream &O, const char *Modifier = nullptr);
00045 
00046   void printU2ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00047   void printU4ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00048   void printS5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00049   void printU5ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00050   void printU6ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00051   void printS16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00052   void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00053   void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00054   void printAbsBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00055   void printTLSCall(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00056 
00057   void printcrbitm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00058 
00059   void printMemRegImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00060   void printMemRegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
00061 };
00062 } // end namespace llvm
00063 
00064 #endif