blob: 314420a170422a1b82eb5e2eb75335f5f1ccc0b1 [file] [log] [blame]
Jia Liu8f5e8c12012-02-17 01:23:50 +00001//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===//
Akira Hatanaka17a2f8e2011-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 Lopesce1a5382011-11-08 22:26:47 +000012#include "llvm/ADT/SmallVector.h"
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000013#include "llvm/CodeGen/MachineOperand.h"
14#include "llvm/Support/Compiler.h"
15
16namespace llvm {
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000017 class MCContext;
18 class MCInst;
19 class MCOperand;
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000020 class MachineInstr;
21 class MachineFunction;
22 class Mangler;
23 class MipsAsmPrinter;
Jia Liubb481f82012-02-28 07:46:26 +000024
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000025/// MipsMCInstLower - This class is used to lower an MachineInstr into an
26// MCInst.
27class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
28 typedef MachineOperand::MachineOperandType MachineOperandType;
Akira Hatanakaf93b8632012-03-28 00:22:50 +000029 MCContext *Ctx;
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000030 Mangler *Mang;
31 MipsAsmPrinter &AsmPrinter;
32public:
Akira Hatanakaf93b8632012-03-28 00:22:50 +000033 MipsMCInstLower(MipsAsmPrinter &asmprinter);
Akira Hatanaka864f6602012-06-14 21:10:56 +000034 void Initialize(Mangler *mang, MCContext *C);
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000035 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
36private:
37 MCOperand LowerSymbolOperand(const MachineOperand &MO,
Akira Hatanaka78d1b112011-08-16 02:15:03 +000038 MachineOperandType MOTy, unsigned Offset) const;
Akira Hatanaka421455f2011-11-23 22:19:28 +000039 MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000040};
41}
42
43#endif