LLVM API Documentation

MipsMCInstLower.h
Go to the documentation of this file.
00001 //===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H
00011 #define LLVM_LIB_TARGET_MIPS_MIPSMCINSTLOWER_H
00012 #include "MCTargetDesc/MipsMCExpr.h"
00013 #include "llvm/ADT/SmallVector.h"
00014 #include "llvm/CodeGen/MachineOperand.h"
00015 #include "llvm/Support/Compiler.h"
00016 
00017 namespace llvm {
00018   class MCContext;
00019   class MCInst;
00020   class MCOperand;
00021   class MachineInstr;
00022   class MachineFunction;
00023   class MipsAsmPrinter;
00024 
00025 /// MipsMCInstLower - This class is used to lower an MachineInstr into an
00026 //                    MCInst.
00027 class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
00028   typedef MachineOperand::MachineOperandType MachineOperandType;
00029   MCContext *Ctx;
00030   MipsAsmPrinter &AsmPrinter;
00031 public:
00032   MipsMCInstLower(MipsAsmPrinter &asmprinter);
00033   void Initialize(MCContext *C);
00034   void Lower(const MachineInstr *MI, MCInst &OutMI) const;
00035   MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
00036 
00037 private:
00038   MCOperand LowerSymbolOperand(const MachineOperand &MO,
00039                                MachineOperandType MOTy, unsigned Offset) const;
00040   MCOperand createSub(MachineBasicBlock *BB1, MachineBasicBlock *BB2,
00041                       MCSymbolRefExpr::VariantKind Kind) const;
00042   void lowerLongBranchLUi(const MachineInstr *MI, MCInst &OutMI) const;
00043   void lowerLongBranchADDiu(const MachineInstr *MI, MCInst &OutMI,
00044                             int Opcode,
00045                             MCSymbolRefExpr::VariantKind Kind) const;
00046   bool lowerLongBranch(const MachineInstr *MI, MCInst &OutMI) const;
00047 };
00048 }
00049 
00050 #endif