MLIR  22.0.0git
Namespaces | Macros | Functions
TranslateFromWasm.cpp File Reference
#include "mlir/Dialect/WasmSSA/IR/WasmSSA.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributeInterfaces.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Location.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Target/Wasm/WasmBinaryEncoding.h"
#include "mlir/Target/Wasm/WasmImporter.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/LogicalResult.h"
#include <cstddef>
#include <cstdint>
#include <variant>

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::wasm
 

Macros

#define DEBUG_TYPE   "wasm-translate"
 
#define APPLY_WASM_SEC_TRANSFORM
 
#define WASM_SEC_TRANSFORM(section)
 
#define BUILD_NUMERIC_OP(OP_NAME, N_ARGS, PREFIX, SUFFIX, TYPE)
 
#define BUILD_NUMERIC_BINOP_INT(OP_NAME, PREFIX)
 
#define BUILD_NUMERIC_BINOP_FP(OP_NAME, PREFIX)
 
#define BUILD_NUMERIC_BINOP_INTFP(OP_NAME, PREFIX)
 
#define BUILD_NUMERIC_UNARY_OP_INT(OP_NAME, PREFIX)
 
#define BUILD_NUMERIC_UNARY_OP_FP(OP_NAME, PREFIX)
 

Functions

OwningOpRef< ModuleOp > mlir::wasm::importWebAssemblyToModule (llvm::SourceMgr &source, MLIRContext *context)
 If source contains a valid Wasm binary file, this function returns a a ModuleOp containing the representation of the Wasm module encoded in the source file in the wasmssa dialect. More...
 

Macro Definition Documentation

◆ APPLY_WASM_SEC_TRANSFORM

#define APPLY_WASM_SEC_TRANSFORM
Value:
WASM_SEC_TRANSFORM(TYPE) \
WASM_SEC_TRANSFORM(IMPORT) \
WASM_SEC_TRANSFORM(FUNCTION) \
WASM_SEC_TRANSFORM(TABLE) \
WASM_SEC_TRANSFORM(MEMORY) \
WASM_SEC_TRANSFORM(GLOBAL) \
WASM_SEC_TRANSFORM(EXPORT) \
WASM_SEC_TRANSFORM(START) \
WASM_SEC_TRANSFORM(ELEMENT) \
WASM_SEC_TRANSFORM(CODE) \
WASM_SEC_TRANSFORM(DATA) \
WASM_SEC_TRANSFORM(DATACOUNT)
#define EXPORT
#define WASM_SEC_TRANSFORM(section)

Definition at line 63 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_BINOP_FP

#define BUILD_NUMERIC_BINOP_FP (   OP_NAME,
  PREFIX 
)
Value:
BUILD_NUMERIC_OP(OP_NAME, 2, PREFIX, F32, float) \
BUILD_NUMERIC_OP(OP_NAME, 2, PREFIX, F64, double)
#define BUILD_NUMERIC_OP(OP_NAME, N_ARGS, PREFIX, SUFFIX, TYPE)

Definition at line 982 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_BINOP_INT

#define BUILD_NUMERIC_BINOP_INT (   OP_NAME,
  PREFIX 
)
Value:
BUILD_NUMERIC_OP(OP_NAME, 2, PREFIX, I32, int32_t) \
BUILD_NUMERIC_OP(OP_NAME, 2, PREFIX, I64, int64_t)

Definition at line 977 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_BINOP_INTFP

#define BUILD_NUMERIC_BINOP_INTFP (   OP_NAME,
  PREFIX 
)
Value:
BUILD_NUMERIC_BINOP_INT(OP_NAME, PREFIX) \
BUILD_NUMERIC_BINOP_FP(OP_NAME, PREFIX)
#define BUILD_NUMERIC_BINOP_INT(OP_NAME, PREFIX)

Definition at line 987 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_OP

#define BUILD_NUMERIC_OP (   OP_NAME,
  N_ARGS,
  PREFIX,
  SUFFIX,
  TYPE 
)
Value:
template <> \
inline parsed_inst_t ExpressionParser::parseSpecificInstruction< \
WasmBinaryEncoding::OpCode::PREFIX##SUFFIX>(OpBuilder & builder) { \
return buildNumericOp<OP_NAME, TYPE, N_ARGS>(builder); \
}
This class helps build Operations.
Definition: Builders.h:205

Definition at line 969 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_UNARY_OP_FP

#define BUILD_NUMERIC_UNARY_OP_FP (   OP_NAME,
  PREFIX 
)
Value:
BUILD_NUMERIC_OP(OP_NAME, 1, PREFIX, F32, float) \
BUILD_NUMERIC_OP(OP_NAME, 1, PREFIX, F64, double)

Definition at line 997 of file TranslateFromWasm.cpp.

◆ BUILD_NUMERIC_UNARY_OP_INT

#define BUILD_NUMERIC_UNARY_OP_INT (   OP_NAME,
  PREFIX 
)
Value:
BUILD_NUMERIC_OP(OP_NAME, 1, PREFIX, I32, int32_t) \
BUILD_NUMERIC_OP(OP_NAME, 1, PREFIX, I64, int64_t)

Definition at line 992 of file TranslateFromWasm.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-translate"

Definition at line 33 of file TranslateFromWasm.cpp.

◆ WASM_SEC_TRANSFORM

#define WASM_SEC_TRANSFORM (   section)
Value:
template <> \
[[maybe_unused]] constexpr const char \
*wasmSectionName<WasmSectionType::section> = #section;

Definition at line 81 of file TranslateFromWasm.cpp.