2015-11-06 03:28:16 +08:00
|
|
|
//===-- WebAssemblyMCInstLower.h - Lower MachineInstr to MCInst -*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// \brief This file declares the class to lower WebAssembly MachineInstrs to
|
|
|
|
/// 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 {
|
|
|
|
class AsmPrinter;
|
|
|
|
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;
|
|
|
|
AsmPrinter &Printer;
|
|
|
|
|
2015-12-22 01:19:31 +08:00
|
|
|
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
|
|
|
|
MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
|
2016-01-12 07:38:05 +08:00
|
|
|
MCOperand LowerSymbolOperand(MCSymbol *Sym, int64_t Offset,
|
|
|
|
bool IsFunc) const;
|
2015-12-22 01:19:31 +08:00
|
|
|
|
2015-11-06 03:28:16 +08:00
|
|
|
public:
|
|
|
|
WebAssemblyMCInstLower(MCContext &ctx, AsmPrinter &printer)
|
|
|
|
: 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
|