• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- SystemZMCInstLower.h - Lower MachineInstr to MCInst ----*- 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 #ifndef LLVM_SYSTEMZMCINSTLOWER_H
11 #define LLVM_SYSTEMZMCINSTLOWER_H
12 
13 #include "llvm/Support/DataTypes.h"
14 #include "llvm/Support/Compiler.h"
15 
16 namespace llvm {
17 class MCContext;
18 class MCInst;
19 class MCOperand;
20 class MCSymbol;
21 class MachineInstr;
22 class MachineOperand;
23 class Mangler;
24 class SystemZAsmPrinter;
25 
26 class LLVM_LIBRARY_VISIBILITY SystemZMCInstLower {
27   Mangler *Mang;
28   MCContext &Ctx;
29   SystemZAsmPrinter &AsmPrinter;
30 
31 public:
32   SystemZMCInstLower(Mangler *mang, MCContext &ctx,
33                      SystemZAsmPrinter &asmPrinter);
34 
35   // Lower MachineInstr MI to MCInst OutMI.
36   void lower(const MachineInstr *MI, MCInst &OutMI) const;
37 
38   // Return an MCOperand for MO.
39   MCOperand lowerOperand(const MachineOperand& MO) const;
40 
41   // Return an MCOperand for MO, given that it equals Symbol + Offset.
42   MCOperand lowerSymbolOperand(const MachineOperand &MO,
43                                const MCSymbol *Symbol, int64_t Offset) const;
44 };
45 } // end namespace llvm
46 
47 #endif
48