blob: d2a76b9cdc00ad2f635aa8ca78760f597e2bce94 [file] [log] [blame]
Anton Korobeynikov1c7ceed2009-10-21 00:11:08 +00001//===-- 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
15namespace 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.
28class VISIBILITY_HIDDEN MSP430MCInstLower {
29 MCContext &Ctx;
Anton Korobeynikovbaffc352009-10-21 00:12:08 +000030 Mangler &Mang;
Anton Korobeynikov1c7ceed2009-10-21 00:11:08 +000031
Anton Korobeynikov1c7ceed2009-10-21 00:11:08 +000032 const unsigned CurFunctionNumber;
33 const MCAsmInfo &MAI;
Anton Korobeynikov1c7ceed2009-10-21 00:11:08 +000034
35public:
Anton Korobeynikovbaffc352009-10-21 00:12:08 +000036 MSP430MCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum,
37 const MCAsmInfo &mai)
38 : Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {}
Anton Korobeynikov1c7ceed2009-10-21 00:11:08 +000039 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
Anton Korobeynikovbaffc352009-10-21 00:12:08 +000040
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 Korobeynikov1c7ceed2009-10-21 00:11:08 +000046};
47
48}
49
50#endif