X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FTarget%2FMips%2FMipsMCInstLower.h;h=1ce27e40185032f574237ea7100ba6c9d8a659a1;hb=cac05d9b5837f7d5bc73d9d87b555ca9e562d351;hp=1490c142e247311bae07ab9e875b47bedba4ebe6;hpb=044a784fa586cf92bb712c6dc54f925f539e19d1;p=oota-llvm.git diff --git a/lib/Target/Mips/MipsMCInstLower.h b/lib/Target/Mips/MipsMCInstLower.h index 1490c142e24..1ce27e40185 100644 --- a/lib/Target/Mips/MipsMCInstLower.h +++ b/lib/Target/Mips/MipsMCInstLower.h @@ -1,4 +1,4 @@ -//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------------------==// +//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===// // // The LLVM Compiler Infrastructure // @@ -7,42 +7,43 @@ // //===----------------------------------------------------------------------===// -#ifndef MIPSMCINSTLOWER_H -#define MIPSMCINSTLOWER_H +#ifndef LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H +#define LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H +#include "MCTargetDesc/MipsMCExpr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/Support/Compiler.h" namespace llvm { - class MCAsmInfo; class MCContext; class MCInst; class MCOperand; - class MCSymbol; class MachineInstr; class MachineFunction; - class Mangler; class MipsAsmPrinter; - + /// MipsMCInstLower - This class is used to lower an MachineInstr into an // MCInst. class LLVM_LIBRARY_VISIBILITY MipsMCInstLower { typedef MachineOperand::MachineOperandType MachineOperandType; - MCContext &Ctx; - Mangler *Mang; + MCContext *Ctx; MipsAsmPrinter &AsmPrinter; public: - MipsMCInstLower(Mangler *mang, const MachineFunction &MF, - MipsAsmPrinter &asmprinter); + MipsMCInstLower(MipsAsmPrinter &asmprinter); + void Initialize(MCContext *C); void Lower(const MachineInstr *MI, MCInst &OutMI) const; - void LowerCPLOAD(const MachineInstr *MI, SmallVector& MCInsts); - void LowerCPRESTORE(const MachineInstr *MI, SmallVector& MCInsts); - void LowerUnalignedLoadStore(const MachineInstr *MI, - SmallVector& MCInsts); + MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const; + private: MCOperand LowerSymbolOperand(const MachineOperand &MO, MachineOperandType MOTy, unsigned Offset) const; - MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const; + MCOperand createSub(MachineBasicBlock *BB1, MachineBasicBlock *BB2, + MCSymbolRefExpr::VariantKind Kind) const; + void lowerLongBranchLUi(const MachineInstr *MI, MCInst &OutMI) const; + void lowerLongBranchADDiu(const MachineInstr *MI, MCInst &OutMI, + int Opcode, + MCSymbolRefExpr::VariantKind Kind) const; + bool lowerLongBranch(const MachineInstr *MI, MCInst &OutMI) const; }; }