LLVM  10.0.0svn
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/MC/MCInst.h"
19 #include "llvm/Support/Compiler.h"
20 
21 namespace llvm {
22 class WebAssemblyAsmPrinter;
23 class MCContext;
24 class MCSymbol;
25 class MachineInstr;
26 class MachineOperand;
27 
28 /// This class is used to lower an MachineInstr into an MCInst.
30  MCContext &Ctx;
32 
33  MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
34  MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
35  MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
36 
37 public:
39  : Ctx(ctx), Printer(printer) {}
40  void lower(const MachineInstr *MI, MCInst &OutMI) const;
41 };
42 } // end namespace llvm
43 
44 #endif
This class is used to lower an MachineInstr into an MCInst.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
WebAssemblyMCInstLower(MCContext &ctx, WebAssemblyAsmPrinter &printer)
print alias Alias Set Printer
Context object for machine code objects.
Definition: MCContext.h:65
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:158
static MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym, const AsmPrinter &AP)
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
Definition: Compiler.h:124
MachineOperand class - Representation of each machine instruction operand.
Representation of each machine instruction.
Definition: MachineInstr.h:64
IRTranslator LLVM IR MI
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:34