Chris Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 1 | //===-- 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 Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 13 | namespace 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 Lattner | 6874849 | 2009-09-12 21:01:20 +0000 | [diff] [blame^] | 24 | /// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst. |
Chris Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 25 | class X86MCInstLower { |
| 26 | MCContext &Ctx; |
| 27 | Mangler *Mang; |
| 28 | X86ATTAsmPrinter &AsmPrinter; |
Chris Lattner | 6874849 | 2009-09-12 21:01:20 +0000 | [diff] [blame^] | 29 | |
| 30 | const X86Subtarget &getSubtarget() const; |
Chris Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 31 | public: |
| 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 Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 34461fd | 2009-09-12 20:45:03 +0000 | [diff] [blame] | 39 | MCOperand LowerMBBOperand(const MachineOperand &MO) const; |
Chris Lattner | 1efc2ad | 2009-09-12 20:34:57 +0000 | [diff] [blame] | 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 |