blob: de85755d723821296cf9bbe57980b766d522d7d1 [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
13
14namespace llvm {
15 class MCContext;
16 class MCInst;
17 class MCOperand;
18 class MCSymbol;
19 class MachineInstr;
20 class MachineOperand;
21 class Mangler;
22 class X86ATTAsmPrinter;
23 class X86Subtarget;
24
25class X86MCInstLower {
26 MCContext &Ctx;
27 Mangler *Mang;
28 X86ATTAsmPrinter &AsmPrinter;
29public:
30 X86MCInstLower(MCContext &ctx, Mangler *mang, X86ATTAsmPrinter &asmprinter)
31 : Ctx(ctx), Mang(mang), AsmPrinter(asmprinter) {}
32
33 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
34
35 MCSymbol *GetPICBaseSymbol() const;
36
37private:
38 const X86Subtarget &getSubtarget() const;
39
40 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