Home | History | Annotate | Download | only in X86
      1 //===-- X86MCInstLower.h - Lower MachineInstr to MCInst ---------*- C++ -*-===//
      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 MCAsmInfo;
     17   class MCContext;
     18   class MCInst;
     19   class MCOperand;
     20   class MCSymbol;
     21   class MachineInstr;
     22   class MachineFunction;
     23   class MachineModuleInfoMachO;
     24   class MachineOperand;
     25   class Mangler;
     26   class TargetMachine;
     27   class X86AsmPrinter;
     28 
     29 /// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
     30 class LLVM_LIBRARY_VISIBILITY X86MCInstLower {
     31   MCContext &Ctx;
     32   Mangler *Mang;
     33   const MachineFunction &MF;
     34   const TargetMachine &TM;
     35   const MCAsmInfo &MAI;
     36   X86AsmPrinter &AsmPrinter;
     37 public:
     38   X86MCInstLower(Mangler *mang, const MachineFunction &MF,
     39                  X86AsmPrinter &asmprinter);
     40 
     41   void Lower(const MachineInstr *MI, MCInst &OutMI) const;
     42 
     43   MCSymbol *GetSymbolFromOperand(const MachineOperand &MO) const;
     44   MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
     45 
     46 private:
     47   MachineModuleInfoMachO &getMachOMMI() const;
     48 };
     49 
     50 }
     51 
     52 #endif
     53