1*9880d681SAndroid Build Coastguard Worker //===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H 11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H 12*9880d681SAndroid Build Coastguard Worker #include "MCTargetDesc/MipsMCExpr.h" 13*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/MachineOperand.h" 14*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Compiler.h" 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Worker namespace llvm { 17*9880d681SAndroid Build Coastguard Worker class MCContext; 18*9880d681SAndroid Build Coastguard Worker class MCInst; 19*9880d681SAndroid Build Coastguard Worker class MCOperand; 20*9880d681SAndroid Build Coastguard Worker class MachineInstr; 21*9880d681SAndroid Build Coastguard Worker class MachineFunction; 22*9880d681SAndroid Build Coastguard Worker class MipsAsmPrinter; 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker /// MipsMCInstLower - This class is used to lower an MachineInstr into an 25*9880d681SAndroid Build Coastguard Worker // MCInst. 26*9880d681SAndroid Build Coastguard Worker class LLVM_LIBRARY_VISIBILITY MipsMCInstLower { 27*9880d681SAndroid Build Coastguard Worker typedef MachineOperand::MachineOperandType MachineOperandType; 28*9880d681SAndroid Build Coastguard Worker MCContext *Ctx; 29*9880d681SAndroid Build Coastguard Worker MipsAsmPrinter &AsmPrinter; 30*9880d681SAndroid Build Coastguard Worker public: 31*9880d681SAndroid Build Coastguard Worker MipsMCInstLower(MipsAsmPrinter &asmprinter); 32*9880d681SAndroid Build Coastguard Worker void Initialize(MCContext *C); 33*9880d681SAndroid Build Coastguard Worker void Lower(const MachineInstr *MI, MCInst &OutMI) const; 34*9880d681SAndroid Build Coastguard Worker MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const; 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Worker private: 37*9880d681SAndroid Build Coastguard Worker MCOperand LowerSymbolOperand(const MachineOperand &MO, 38*9880d681SAndroid Build Coastguard Worker MachineOperandType MOTy, unsigned Offset) const; 39*9880d681SAndroid Build Coastguard Worker MCOperand createSub(MachineBasicBlock *BB1, MachineBasicBlock *BB2, 40*9880d681SAndroid Build Coastguard Worker MipsMCExpr::MipsExprKind Kind) const; 41*9880d681SAndroid Build Coastguard Worker void lowerLongBranchLUi(const MachineInstr *MI, MCInst &OutMI) const; 42*9880d681SAndroid Build Coastguard Worker void lowerLongBranchADDiu(const MachineInstr *MI, MCInst &OutMI, int Opcode, 43*9880d681SAndroid Build Coastguard Worker MipsMCExpr::MipsExprKind Kind) const; 44*9880d681SAndroid Build Coastguard Worker bool lowerLongBranch(const MachineInstr *MI, MCInst &OutMI) const; 45*9880d681SAndroid Build Coastguard Worker }; 46*9880d681SAndroid Build Coastguard Worker } 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker #endif 49