blob: c4d27f88df111c53d6964dd8c17c2dbb3875cff2 [file] [log] [blame]
Chris Lattner9cf0eb52009-10-19 20:21:05 +00001//===-- ARMMCInstLower.h - Lower MachineInstr to MCInst -------------------===//
2//
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 ARM_MCINSTLOWER_H
11#define ARM_MCINSTLOWER_H
12
13#include "llvm/Support/Compiler.h"
14
15namespace llvm {
Chris Lattner96bc2172009-10-20 00:52:47 +000016 class AsmPrinter;
Jim Grosbachc686e332010-09-17 18:25:25 +000017 class GlobalValue;
Chris Lattner6f997762009-10-19 21:53:00 +000018 class MCAsmInfo;
Chris Lattner9cf0eb52009-10-19 20:21:05 +000019 class MCContext;
20 class MCInst;
21 class MCOperand;
22 class MCSymbol;
Jim Grosbachc686e332010-09-17 18:25:25 +000023 class MCSymbolRefExpr;
Chris Lattner9cf0eb52009-10-19 20:21:05 +000024 class MachineInstr;
25 class MachineModuleInfoMachO;
26 class MachineOperand;
27 class Mangler;
28 //class ARMSubtarget;
Jim Grosbachfc16a892010-09-13 18:25:42 +000029
Chris Lattner9cf0eb52009-10-19 20:21:05 +000030/// ARMMCInstLower - This class is used to lower an MachineInstr into an MCInst.
Duncan Sands16d8f8b2010-05-11 20:16:09 +000031class LLVM_LIBRARY_VISIBILITY ARMMCInstLower {
Chris Lattner9cf0eb52009-10-19 20:21:05 +000032 MCContext &Ctx;
Chris Lattner6f997762009-10-19 21:53:00 +000033 Mangler &Mang;
Chris Lattner96bc2172009-10-20 00:52:47 +000034 AsmPrinter &Printer;
Chris Lattner9cf0eb52009-10-19 20:21:05 +000035
36 //const ARMSubtarget &getSubtarget() const;
37public:
Chris Lattner96bc2172009-10-20 00:52:47 +000038 ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
39 : Ctx(ctx), Mang(mang), Printer(printer) {}
Jim Grosbachfc16a892010-09-13 18:25:42 +000040
Chris Lattner9cf0eb52009-10-19 20:21:05 +000041 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
42
Chris Lattner6f997762009-10-19 21:53:00 +000043 //MCSymbol *GetPICBaseSymbol() const;
Jim Grosbachc686e332010-09-17 18:25:25 +000044 MCSymbol *GetGlobalAddressSymbol(const GlobalValue *GV) const;
45 const MCSymbolRefExpr *GetSymbolRef(const MachineOperand &MO) const;
Jim Grosbach637d89f2010-09-22 23:27:36 +000046 const MCSymbolRefExpr *GetExternalSymbolSymbol(const MachineOperand &MO)
47 const;
Chris Lattner9cf0eb52009-10-19 20:21:05 +000048 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
49 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
Jim Grosbachc686e332010-09-17 18:25:25 +000050 MCOperand LowerSymbolRefOperand(const MachineOperand &MO,
51 const MCSymbolRefExpr *Expr) const;
Chris Lattner9cf0eb52009-10-19 20:21:05 +000052 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
Jim Grosbachfc16a892010-09-13 18:25:42 +000053
Chris Lattner6f997762009-10-19 21:53:00 +000054/*
Chris Lattner9cf0eb52009-10-19 20:21:05 +000055private:
56 MachineModuleInfoMachO &getMachOMMI() const;
57 */
58};
59
60}
61
62#endif