blob: 4570bd90997fb6011b66769d305d0dd52177b7aa [file] [log] [blame]
Jia Liudd6c1cd2012-02-17 01:23:50 +00001//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===//
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +00002//
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 MIPSMCINSTLOWER_H
11#define MIPSMCINSTLOWER_H
Bruno Cardoso Lopesd5edb382011-11-08 22:26:47 +000012#include "llvm/ADT/SmallVector.h"
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000013#include "llvm/CodeGen/MachineOperand.h"
14#include "llvm/Support/Compiler.h"
15
16namespace llvm {
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000017 class MCContext;
18 class MCInst;
19 class MCOperand;
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000020 class MachineInstr;
21 class MachineFunction;
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000022 class MipsAsmPrinter;
Jia Liuf54f60f2012-02-28 07:46:26 +000023
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000024/// MipsMCInstLower - This class is used to lower an MachineInstr into an
25// MCInst.
26class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
27 typedef MachineOperand::MachineOperandType MachineOperandType;
Akira Hatanaka34ee3ff2012-03-28 00:22:50 +000028 MCContext *Ctx;
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000029 MipsAsmPrinter &AsmPrinter;
30public:
Akira Hatanaka34ee3ff2012-03-28 00:22:50 +000031 MipsMCInstLower(MipsAsmPrinter &asmprinter);
Rafael Espindola7d78b2a2013-10-29 16:24:21 +000032 void Initialize(MCContext *C);
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000033 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
Akira Hatanaka42a35242012-09-27 01:59:07 +000034 MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
Jack Carterf6490432012-07-16 15:14:51 +000035
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000036private:
37 MCOperand LowerSymbolOperand(const MachineOperand &MO,
Akira Hatanaka6520b982011-08-16 02:15:03 +000038 MachineOperandType MOTy, unsigned Offset) const;
Akira Hatanaka77a9e6e2011-07-07 20:24:54 +000039};
40}
41
42#endif