LLVM 20.0.0git
WebAssemblyInstPrinter.h
Go to the documentation of this file.
1// WebAssemblyInstPrinter.h - Print wasm MCInst to assembly syntax -*- 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 class prints an WebAssembly MCInst to wasm file syntax.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_INSTPRINTER_WEBASSEMBLYINSTPRINTER_H
15#define LLVM_LIB_TARGET_WEBASSEMBLY_INSTPRINTER_WEBASSEMBLYINSTPRINTER_H
16
21
22namespace llvm {
23
24class MCSubtargetInfo;
25
27 uint64_t ControlFlowCounter = 0;
28 SmallVector<std::pair<uint64_t, bool>, 4> ControlFlowStack;
30
31 enum EHInstKind { TRY, CATCH, CATCH_ALL };
33
34public:
36 const MCRegisterInfo &MRI);
37
38 void printRegName(raw_ostream &OS, MCRegister Reg) const override;
39 void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
40 const MCSubtargetInfo &STI, raw_ostream &OS) override;
41
42 // Used by tblegen code.
43 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
44 bool IsVariadicDef = false);
45 void printBrList(const MCInst *MI, unsigned OpNo, raw_ostream &O);
46 void printWebAssemblyP2AlignOperand(const MCInst *MI, unsigned OpNo,
47 raw_ostream &O);
48 void printWebAssemblySignatureOperand(const MCInst *MI, unsigned OpNo,
49 raw_ostream &O);
50
51 // Autogenerated by tblgen.
52 std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;
54 static const char *getRegisterName(MCRegister Reg);
55};
56
57} // end namespace llvm
58
59#endif
IRTranslator LLVM IR MI
unsigned Reg
raw_pwrite_stream & OS
This file defines the SmallVector class.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:45
const MCInstrInfo & MII
Definition: MCInstPrinter.h:52
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:53
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:51
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:33
Generic base class for all target subtargets.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
void printWebAssemblySignatureOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printRegName(raw_ostream &OS, MCRegister Reg) const override
Print the assembler register name.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
std::pair< const char *, uint64_t > getMnemonic(const MCInst *MI) override
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by p...
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS) override
Print the specified MCInst to the specified raw_ostream.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O, bool IsVariadicDef=false)
void printBrList(const MCInst *MI, unsigned OpNo, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
void printWebAssemblyP2AlignOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18