LLVM  14.0.0git
WebAssemblyMCInstLower.h
Go to the documentation of this file.
1 //===-- WebAssemblyMCInstLower.h - Lower MachineInstr to MCInst -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file declares the class to lower WebAssembly MachineInstrs to
11 /// their corresponding MCInst records.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
16 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
17 
18 #include "llvm/BinaryFormat/Wasm.h"
19 #include "llvm/MC/MCInst.h"
20 #include "llvm/Support/Compiler.h"
21 
22 namespace llvm {
23 class WebAssemblyAsmPrinter;
24 class MCContext;
25 class MCSymbol;
26 class MachineInstr;
27 class MachineOperand;
28 
29 /// This class is used to lower an MachineInstr into an MCInst.
31  MCContext &Ctx;
33 
34  MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
35  MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
36  MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
37  MCOperand lowerTypeIndexOperand(SmallVector<wasm::ValType, 1> &&,
39 
40 public:
42  : Ctx(ctx), Printer(printer) {}
43  void lower(const MachineInstr *MI, MCInst &OutMI) const;
44 };
45 } // end namespace llvm
46 
47 #endif
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::WebAssemblyMCInstLower
This class is used to lower an MachineInstr into an MCInst.
Definition: WebAssemblyMCInstLower.h:30
Printer
print alias Alias Set Printer
Definition: AliasSetTracker.cpp:762
MCInst.h
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:49
llvm::WebAssemblyMCInstLower::WebAssemblyMCInstLower
WebAssemblyMCInstLower(MCContext &ctx, WebAssemblyAsmPrinter &printer)
Definition: WebAssemblyMCInstLower.h:41
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::WebAssemblyAsmPrinter
Definition: WebAssemblyAsmPrinter.h:21
Compiler.h
lowerSymbolOperand
static MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym, const AsmPrinter &AP)
Definition: RISCVMCInstLower.cpp:29
LLVM_LIBRARY_VISIBILITY
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library,...
Definition: Compiler.h:131
Wasm.h
llvm::MCOperand
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:36
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172