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 | 64fffadad3cfec0fa529f591ccfd9dfeb8bdeb31 (patch) | |
tree | 1a6df8a110ddea8278a1c8d6f3f78c5e03e8724f /llvm/lib/Target/X86/X86MCInstLower.h | |
parent | 9de0ca73d4b50f1edb905e510edf9b2244e43fee (diff) | |
download | bcm5719-llvm-64fffadad3cfec0fa529f591ccfd9dfeb8bdeb31.tar.gz bcm5719-llvm-64fffadad3cfec0fa529f591ccfd9dfeb8bdeb31.zip |
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.
llvm-svn: 108782
Diffstat (limited to 'llvm/lib/Target/X86/X86MCInstLower.h')
-rw-r--r-- | llvm/lib/Target/X86/X86MCInstLower.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86MCInstLower.h b/llvm/lib/Target/X86/X86MCInstLower.h new file mode 100644 index 00000000000..9e5474fc81b --- /dev/null +++ b/llvm/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 |