Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 1 | //===-- MSP430MCInstLower.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 MSP430_MCINSTLOWER_H |
| 11 | #define MSP430_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 MachineModuleInfoMachO; |
| 23 | class MachineOperand; |
| 24 | class Mangler; |
| 25 | |
| 26 | /// MSP430MCInstLower - This class is used to lower an MachineInstr |
| 27 | /// into an MCInst. |
| 28 | class VISIBILITY_HIDDEN MSP430MCInstLower { |
| 29 | MCContext &Ctx; |
Anton Korobeynikov | baffc35 | 2009-10-21 00:12:08 +0000 | [diff] [blame^] | 30 | Mangler &Mang; |
Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 31 | |
Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 32 | const unsigned CurFunctionNumber; |
| 33 | const MCAsmInfo &MAI; |
Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 34 | |
| 35 | public: |
Anton Korobeynikov | baffc35 | 2009-10-21 00:12:08 +0000 | [diff] [blame^] | 36 | MSP430MCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum, |
| 37 | const MCAsmInfo &mai) |
| 38 | : Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {} |
Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 39 | void Lower(const MachineInstr *MI, MCInst &OutMI) const; |
Anton Korobeynikov | baffc35 | 2009-10-21 00:12:08 +0000 | [diff] [blame^] | 40 | |
| 41 | MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const; |
| 42 | |
| 43 | MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const; |
| 44 | MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const; |
| 45 | MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const; |
Anton Korobeynikov | 1c7ceed | 2009-10-21 00:11:08 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } |
| 49 | |
| 50 | #endif |