pass around MF, not MMI.
[oota-llvm.git] / lib / Target / X86 / X86MCInstLower.h
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
13 #include "llvm/Support/Compiler.h"
14
15 namespace llvm {
16   class MCContext;
17   class MCInst;
18   class MCOperand;
19   class MCSymbol;
20   class MachineInstr;
21   class MachineFunction;
22   class MachineModuleInfoMachO;
23   class MachineOperand;
24   class Mangler;
25   class X86AsmPrinter;
26   
27 /// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
28 class LLVM_LIBRARY_VISIBILITY X86MCInstLower {
29   MCContext &Ctx;
30   Mangler *Mang;
31   X86AsmPrinter &AsmPrinter;
32   const MachineFunction &MF;
33 public:
34   X86MCInstLower(MCContext &ctx, Mangler *mang, X86AsmPrinter &asmprinter);
35   
36   void Lower(const MachineInstr *MI, MCInst &OutMI) const;
37
38   MCSymbol *GetPICBaseSymbol() const;
39   
40   MCSymbol *GetSymbolFromOperand(const MachineOperand &MO) const;
41   MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
42   
43 private:
44   MachineModuleInfoMachO &getMachOMMI() const;
45 };
46
47 }
48
49 #endif