AMDGPU/SI: Test commit
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyMCInstLower.h
1 //===-- WebAssemblyMCInstLower.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 /// \file
11 /// \brief This file declares the class to lower WebAssembly MachineInstrs to
12 /// their corresponding MCInst records.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
17 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
18
19 #include "llvm/Support/Compiler.h"
20
21 namespace llvm {
22 class AsmPrinter;
23 class MCContext;
24 class MCInst;
25 class MCOperand;
26 class MCSymbol;
27 class MachineInstr;
28 class MachineModuleInfoMachO;
29 class MachineOperand;
30 class Mangler;
31
32 // WebAssemblyMCInstLower - This class is used to lower an MachineInstr into an
33 // MCInst.
34 class LLVM_LIBRARY_VISIBILITY WebAssemblyMCInstLower {
35   MCContext &Ctx;
36
37   AsmPrinter &Printer;
38
39 public:
40   WebAssemblyMCInstLower(MCContext &ctx, AsmPrinter &printer)
41       : Ctx(ctx), Printer(printer) {}
42   void Lower(const MachineInstr *MI, MCInst &OutMI) const;
43
44   MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
45
46   MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
47   MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
48 };
49 }
50
51 #endif