blob: 2f9691ed097827b1800101444e0d2014f10d1583 [file] [log] [blame]
Chris Lattner1efc2ad2009-09-12 20:34:57 +00001//===-- X86MCInstLower.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 X86_MCINSTLOWER_H
11#define X86_MCINSTLOWER_H
12
Chris Lattner1efc2ad2009-09-12 20:34:57 +000013namespace llvm {
14 class MCContext;
15 class MCInst;
16 class MCOperand;
17 class MCSymbol;
18 class MachineInstr;
19 class MachineOperand;
20 class Mangler;
21 class X86ATTAsmPrinter;
22 class X86Subtarget;
23
Chris Lattner68748492009-09-12 21:01:20 +000024/// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
Chris Lattner1efc2ad2009-09-12 20:34:57 +000025class X86MCInstLower {
26 MCContext &Ctx;
27 Mangler *Mang;
28 X86ATTAsmPrinter &AsmPrinter;
Chris Lattner68748492009-09-12 21:01:20 +000029
30 const X86Subtarget &getSubtarget() const;
Chris Lattner1efc2ad2009-09-12 20:34:57 +000031public:
32 X86MCInstLower(MCContext &ctx, Mangler *mang, X86ATTAsmPrinter &asmprinter)
33 : Ctx(ctx), Mang(mang), AsmPrinter(asmprinter) {}
34
35 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
36
37 MCSymbol *GetPICBaseSymbol() const;
Chris Lattner1efc2ad2009-09-12 20:34:57 +000038
Chris Lattner34461fd2009-09-12 20:45:03 +000039 MCOperand LowerMBBOperand(const MachineOperand &MO) const;
Chris Lattner1efc2ad2009-09-12 20:34:57 +000040 MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
41 MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
42 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
43 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
44 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
45};
46
47}
48
49#endif