LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SystemZInstPrinter.h
Go to the documentation of this file.
1 //==- SystemZInstPrinter.h - Convert SystemZ MCInst to assembly --*- 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 a SystemZ MCInst to a .s file.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_SYSTEMZINSTPRINTER_H
15 #define LLVM_SYSTEMZINSTPRINTER_H
16 
17 #include "llvm/MC/MCInstPrinter.h"
18 #include "llvm/Support/Compiler.h"
19 
20 namespace llvm {
21 class MCOperand;
22 
24 public:
26  const MCRegisterInfo &MRI)
27  : MCInstPrinter(MAI, MII, MRI) {}
28 
29  // Automatically generated by tblgen.
30  void printInstruction(const MCInst *MI, raw_ostream &O);
31  static const char *getRegisterName(unsigned RegNo);
32 
33  // Print an address with the given base, displacement and index.
34  static void printAddress(unsigned Base, int64_t Disp, unsigned Index,
35  raw_ostream &O);
36 
37  // Print the given operand.
38  static void printOperand(const MCOperand &MO, raw_ostream &O);
39 
40  // Override MCInstPrinter.
41  virtual void printRegName(raw_ostream &O, unsigned RegNo) const
43  virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot)
45 
46 private:
47  // Print various types of operand.
48  void printOperand(const MCInst *MI, int OpNum, raw_ostream &O);
49  void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
50  void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
51  void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
52  void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
53  void printU6ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
54  void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
55  void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
56  void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
57  void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
58  void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
59  void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
60  void printPCRelOperand(const MCInst *MI, int OpNum, raw_ostream &O);
61  void printAccessRegOperand(const MCInst *MI, int OpNum, raw_ostream &O);
62 
63  // Print the mnemonic for a condition-code mask ("ne", "lh", etc.)
64  // This forms part of the instruction name rather than the operand list.
65  void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O);
66 };
67 } // end namespace llvm
68 
69 #endif
virtual void printRegName(raw_ostream &O, unsigned RegNo) const LLVM_OVERRIDE
printRegName - Print the assembler register name.
void printInstruction(const MCInst *MI, raw_ostream &O)
static void printAddress(unsigned Base, int64_t Disp, unsigned Index, raw_ostream &O)
SystemZInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
static const char * getRegisterName(unsigned RegNo)
static void printOperand(const MCOperand &MO, raw_ostream &O)
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:39
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) LLVM_OVERRIDE
const MCInstrInfo & MII
Definition: MCInstPrinter.h:40
#define LLVM_OVERRIDE
Definition: Compiler.h:155
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:41