2012-02-17 02:23:50 +01:00
|
|
|
//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===//
|
2011-07-07 22:24:54 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H
|
|
|
|
#define LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H
|
2014-04-30 17:06:25 +02:00
|
|
|
#include "MCTargetDesc/MipsMCExpr.h"
|
2011-07-07 22:24:54 +02:00
|
|
|
#include "llvm/CodeGen/MachineOperand.h"
|
|
|
|
#include "llvm/Support/Compiler.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MCContext;
|
|
|
|
class MCInst;
|
|
|
|
class MCOperand;
|
|
|
|
class MachineInstr;
|
|
|
|
class MachineFunction;
|
|
|
|
class MipsAsmPrinter;
|
2012-02-28 08:46:26 +01:00
|
|
|
|
2011-07-07 22:24:54 +02:00
|
|
|
/// MipsMCInstLower - This class is used to lower an MachineInstr into an
|
|
|
|
// MCInst.
|
|
|
|
class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
|
|
|
|
typedef MachineOperand::MachineOperandType MachineOperandType;
|
2012-03-28 02:22:50 +02:00
|
|
|
MCContext *Ctx;
|
2011-07-07 22:24:54 +02:00
|
|
|
MipsAsmPrinter &AsmPrinter;
|
|
|
|
public:
|
2012-03-28 02:22:50 +02:00
|
|
|
MipsMCInstLower(MipsAsmPrinter &asmprinter);
|
2013-10-29 17:24:21 +01:00
|
|
|
void Initialize(MCContext *C);
|
2011-07-07 22:24:54 +02:00
|
|
|
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
2012-09-27 03:59:07 +02:00
|
|
|
MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
|
2012-07-16 17:14:51 +02:00
|
|
|
|
2011-07-07 22:24:54 +02:00
|
|
|
private:
|
|
|
|
MCOperand LowerSymbolOperand(const MachineOperand &MO,
|
2011-08-16 04:15:03 +02:00
|
|
|
MachineOperandType MOTy, unsigned Offset) const;
|
2014-04-30 17:06:25 +02:00
|
|
|
MCOperand createSub(MachineBasicBlock *BB1, MachineBasicBlock *BB2,
|
|
|
|
MCSymbolRefExpr::VariantKind Kind) const;
|
2014-05-27 20:53:06 +02:00
|
|
|
void lowerLongBranchLUi(const MachineInstr *MI, MCInst &OutMI) const;
|
2014-04-30 17:06:25 +02:00
|
|
|
void lowerLongBranchADDiu(const MachineInstr *MI, MCInst &OutMI,
|
|
|
|
int Opcode,
|
|
|
|
MCSymbolRefExpr::VariantKind Kind) const;
|
|
|
|
bool lowerLongBranch(const MachineInstr *MI, MCInst &OutMI) const;
|
2011-07-07 22:24:54 +02:00
|
|
|
};
|
2015-06-23 11:49:53 +02:00
|
|
|
}
|
2011-07-07 22:24:54 +02:00
|
|
|
|
|
|
|
#endif
|