blob: 6bf557462eb52c7bb383c3a46667c1485cf8d97c [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 Lattnerb47f6412009-09-13 18:33:59 +000013#include "llvm/Support/Compiler.h"
14
Chris Lattner1efc2ad2009-09-12 20:34:57 +000015namespace llvm {
16 class MCContext;
17 class MCInst;
18 class MCOperand;
19 class MCSymbol;
20 class MachineInstr;
21 class MachineOperand;
22 class Mangler;
23 class X86ATTAsmPrinter;
24 class X86Subtarget;
25
Chris Lattner68748492009-09-12 21:01:20 +000026/// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
Chris Lattnerb47f6412009-09-13 18:33:59 +000027class VISIBILITY_HIDDEN X86MCInstLower {
Chris Lattner1efc2ad2009-09-12 20:34:57 +000028 MCContext &Ctx;
29 Mangler *Mang;
30 X86ATTAsmPrinter &AsmPrinter;
Chris Lattner68748492009-09-12 21:01:20 +000031
32 const X86Subtarget &getSubtarget() const;
Chris Lattner1efc2ad2009-09-12 20:34:57 +000033public:
34 X86MCInstLower(MCContext &ctx, Mangler *mang, X86ATTAsmPrinter &asmprinter)
35 : Ctx(ctx), Mang(mang), AsmPrinter(asmprinter) {}
36
37 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
38
39 MCSymbol *GetPICBaseSymbol() const;
Chris Lattner1efc2ad2009-09-12 20:34:57 +000040
Chris Lattner1efc2ad2009-09-12 20:34:57 +000041 MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
42 MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
43 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
44 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
45 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
46};
47
48}
49
50#endif