Make MCRegisterInfo available to the the MCInstPrinter.
[oota-llvm.git] / lib / Target / PTX / InstPrinter / PTXInstPrinter.h
1 //===- PTXInstPrinter.h - Convert PTX MCInst to assembly syntax -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This class prints n PTX MCInst to a .ptx file.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef PTXINSTPRINTER_H
15 #define PTXINSTPRINTER_H
16
17 #include "llvm/MC/MCInstPrinter.h"
18 #include "llvm/MC/MCSubtargetInfo.h"
19
20 namespace llvm {
21
22 class MCOperand;
23
24 class PTXInstPrinter : public MCInstPrinter {
25 public:
26   PTXInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
27                  const MCSubtargetInfo &STI);
28
29   virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
30   virtual StringRef getOpcodeName(unsigned Opcode) const;
31   virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
32
33   static const char *getInstructionName(unsigned Opcode);
34
35   // Autogenerated by tblgen.
36   void printInstruction(const MCInst *MI, raw_ostream &O);
37   static const char *getRegisterName(unsigned RegNo);
38
39   void printPredicate(const MCInst *MI, raw_ostream &O);
40   void printCall(const MCInst *MI, raw_ostream &O);
41   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42   void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43   void printRoundingMode(const MCInst *MI, unsigned OpNo, raw_ostream &O);
44 };
45 }
46
47 #endif
48