1292915Sdim//===-- WebAssemblyMCInstLower.h - Lower MachineInstr to MCInst -*- C++ -*-===//
2292915Sdim//
3292915Sdim//                     The LLVM Compiler Infrastructure
4292915Sdim//
5292915Sdim// This file is distributed under the University of Illinois Open Source
6292915Sdim// License. See LICENSE.TXT for details.
7292915Sdim//
8292915Sdim//===----------------------------------------------------------------------===//
9292915Sdim///
10292915Sdim/// \file
11292915Sdim/// \brief This file declares the class to lower WebAssembly MachineInstrs to
12292915Sdim/// their corresponding MCInst records.
13292915Sdim///
14292915Sdim//===----------------------------------------------------------------------===//
15292915Sdim
16292915Sdim#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
17292915Sdim#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
18292915Sdim
19292915Sdim#include "llvm/MC/MCInst.h"
20292915Sdim#include "llvm/Support/Compiler.h"
21292915Sdim
22292915Sdimnamespace llvm {
23292915Sdimclass AsmPrinter;
24292915Sdimclass MCContext;
25292915Sdimclass MCSymbol;
26292915Sdimclass MachineInstr;
27292915Sdimclass MachineOperand;
28292915Sdim
29292915Sdim/// This class is used to lower an MachineInstr into an MCInst.
30292915Sdimclass LLVM_LIBRARY_VISIBILITY WebAssemblyMCInstLower {
31292915Sdim  MCContext &Ctx;
32292915Sdim  AsmPrinter &Printer;
33292915Sdim
34292915Sdim  MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
35292915Sdim  MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
36294024Sdim  MCOperand LowerSymbolOperand(MCSymbol *Sym, int64_t Offset,
37294024Sdim                               bool IsFunc) const;
38292915Sdim
39292915Sdimpublic:
40292915Sdim  WebAssemblyMCInstLower(MCContext &ctx, AsmPrinter &printer)
41292915Sdim      : Ctx(ctx), Printer(printer) {}
42292915Sdim  void Lower(const MachineInstr *MI, MCInst &OutMI) const;
43292915Sdim};
44292915Sdim} // end namespace llvm
45292915Sdim
46292915Sdim#endif
47