diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-19 23:41:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-19 23:41:57 +0000 |
commit | aef40351f67ce6be3888450836d44ca4e0afd487 (patch) | |
tree | 245a6387da64a341bfdb94f46cacea2e17973dfe /lib/Target/X86/X86MCInstLower.h | |
parent | 94143ee6254944a26adba2200037328c2c8ef289 (diff) | |
download | external_llvm-aef40351f67ce6be3888450836d44ca4e0afd487.zip external_llvm-aef40351f67ce6be3888450836d44ca4e0afd487.tar.gz external_llvm-aef40351f67ce6be3888450836d44ca4e0afd487.tar.bz2 |
fix a layering problem by moving the x86 implementation
of AsmPrinter and InstLowering into libx86 and out of the
asmprinter subdirectory. Now X86/AsmPrinter just depends on
MC stuff, not all of codegen and LLVM IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86MCInstLower.h')
-rw-r--r-- | lib/Target/X86/X86MCInstLower.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Target/X86/X86MCInstLower.h b/lib/Target/X86/X86MCInstLower.h new file mode 100644 index 0000000..9e5474f --- /dev/null +++ b/lib/Target/X86/X86MCInstLower.h @@ -0,0 +1,51 @@ +//===-- X86MCInstLower.h - Lower MachineInstr to MCInst -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef X86_MCINSTLOWER_H +#define X86_MCINSTLOWER_H + +#include "llvm/Support/Compiler.h" + +namespace llvm { + class MCContext; + class MCInst; + class MCOperand; + class MCSymbol; + class MachineInstr; + class MachineModuleInfoMachO; + class MachineOperand; + class Mangler; + class X86AsmPrinter; + class X86Subtarget; + +/// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst. +class LLVM_LIBRARY_VISIBILITY X86MCInstLower { + MCContext &Ctx; + Mangler *Mang; + X86AsmPrinter &AsmPrinter; + + const X86Subtarget &getSubtarget() const; +public: + X86MCInstLower(MCContext &ctx, Mangler *mang, X86AsmPrinter &asmprinter) + : Ctx(ctx), Mang(mang), AsmPrinter(asmprinter) {} + + void Lower(const MachineInstr *MI, MCInst &OutMI) const; + + MCSymbol *GetPICBaseSymbol() const; + + MCSymbol *GetSymbolFromOperand(const MachineOperand &MO) const; + MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const; + +private: + MachineModuleInfoMachO &getMachOMMI() const; +}; + +} + +#endif |