2015-11-06 03:28:16 +08:00
|
|
|
//===-- WebAssemblyMCInstLower.h - Lower MachineInstr to MCInst -*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-11-06 03:28:16 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
2018-05-01 23:54:18 +08:00
|
|
|
/// This file declares the class to lower WebAssembly MachineInstrs to
|
2015-11-06 03:28:16 +08:00
|
|
|
/// their corresponding MCInst records.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
|
|
|
|
#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
|
|
|
|
|
2015-12-22 01:19:31 +08:00
|
|
|
#include "llvm/MC/MCInst.h"
|
2015-11-06 03:28:16 +08:00
|
|
|
#include "llvm/Support/Compiler.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2017-02-25 07:18:00 +08:00
|
|
|
class WebAssemblyAsmPrinter;
|
2015-11-06 03:28:16 +08:00
|
|
|
class MCContext;
|
|
|
|
class MCSymbol;
|
|
|
|
class MachineInstr;
|
|
|
|
class MachineOperand;
|
|
|
|
|
2015-12-22 01:19:31 +08:00
|
|
|
/// This class is used to lower an MachineInstr into an MCInst.
|
2015-11-06 03:28:16 +08:00
|
|
|
class LLVM_LIBRARY_VISIBILITY WebAssemblyMCInstLower {
|
|
|
|
MCContext &Ctx;
|
2017-02-25 07:18:00 +08:00
|
|
|
WebAssemblyAsmPrinter &Printer;
|
2015-11-06 03:28:16 +08:00
|
|
|
|
2015-12-22 01:19:31 +08:00
|
|
|
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
|
|
|
|
MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
|
2018-09-05 09:27:38 +08:00
|
|
|
MCOperand LowerSymbolOperand(MCSymbol *Sym, int64_t Offset, bool IsFunc,
|
2018-11-14 10:46:21 +08:00
|
|
|
bool IsGlob, bool IsEvent) const;
|
2015-12-22 01:19:31 +08:00
|
|
|
|
2015-11-06 03:28:16 +08:00
|
|
|
public:
|
2017-02-25 07:18:00 +08:00
|
|
|
WebAssemblyMCInstLower(MCContext &ctx, WebAssemblyAsmPrinter &printer)
|
2015-11-06 03:28:16 +08:00
|
|
|
: Ctx(ctx), Printer(printer) {}
|
|
|
|
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
|
|
|
};
|
2015-12-22 01:19:31 +08:00
|
|
|
} // end namespace llvm
|
2015-11-06 03:28:16 +08:00
|
|
|
|
|
|
|
#endif
|