Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Macros |Functions
WasmObjectFile.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Object/Wasm.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include "llvm/TargetParser/Triple.h"
#include <cassert>
#include <cstdint>
#include <cstring>
#include "llvm/BinaryFormat/WasmRelocs.def"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-object"
 
#define VARINT7_MAX   ((1 << 7) - 1)
 
#define VARINT7_MIN   (-(1 << 7))
 
#define VARUINT7_MAX   (1 << 7)
 
#define VARUINT1_MAX   (1)
 
#define WASM_RELOC(name,value)
 

Functions

staticuint8_t readUint8 (WasmObjectFile::ReadContext &Ctx)
 
staticuint32_t readUint32 (WasmObjectFile::ReadContext &Ctx)
 
static int32_t readFloat32 (WasmObjectFile::ReadContext &Ctx)
 
static int64_t readFloat64 (WasmObjectFile::ReadContext &Ctx)
 
staticuint64_t readULEB128 (WasmObjectFile::ReadContext &Ctx)
 
staticStringRef readString (WasmObjectFile::ReadContext &Ctx)
 
static int64_t readLEB128 (WasmObjectFile::ReadContext &Ctx)
 
staticuint8_t readVaruint1 (WasmObjectFile::ReadContext &Ctx)
 
static int32_t readVarint32 (WasmObjectFile::ReadContext &Ctx)
 
staticuint32_t readVaruint32 (WasmObjectFile::ReadContext &Ctx)
 
static int64_t readVarint64 (WasmObjectFile::ReadContext &Ctx)
 
staticuint64_t readVaruint64 (WasmObjectFile::ReadContext &Ctx)
 
staticuint8_t readOpcode (WasmObjectFile::ReadContext &Ctx)
 
staticwasm::ValType parseValType (WasmObjectFile::ReadContext &Ctx,uint32_t Code)
 
staticError readInitExpr (wasm::WasmInitExpr &Expr,WasmObjectFile::ReadContext &Ctx)
 
staticwasm::WasmLimits readLimits (WasmObjectFile::ReadContext &Ctx)
 
staticwasm::WasmTableType readTableType (WasmObjectFile::ReadContext &Ctx)
 
staticError readSection (WasmSection &Section,WasmObjectFile::ReadContext &Ctx,WasmSectionOrderChecker &Checker)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-object"

Definition at line32 of fileWasmObjectFile.cpp.

◆ VARINT7_MAX

#define VARINT7_MAX   ((1 << 7) - 1)

Definition at line75 of fileWasmObjectFile.cpp.

◆ VARINT7_MIN

#define VARINT7_MIN   (-(1 << 7))

Definition at line76 of fileWasmObjectFile.cpp.

◆ VARUINT1_MAX

#define VARUINT1_MAX   (1)

Definition at line78 of fileWasmObjectFile.cpp.

◆ VARUINT7_MAX

#define VARUINT7_MAX   (1 << 7)

Definition at line77 of fileWasmObjectFile.cpp.

◆ WASM_RELOC

#define WASM_RELOC( name,
 value 
)
Value:
case wasm::name: \
Res = #name; \
break;
static const char * name

Function Documentation

◆ parseValType()

staticwasm::ValType parseValType(WasmObjectFile::ReadContextCtx,
uint32_t Code 
)
static

Definition at line175 of fileWasmObjectFile.cpp.

Referencesllvm::wasm::OTHERREF,readVarint64(),llvm::wasm::WASM_TYPE_EXNREF,llvm::wasm::WASM_TYPE_EXTERNREF,llvm::wasm::WASM_TYPE_F32,llvm::wasm::WASM_TYPE_F64,llvm::wasm::WASM_TYPE_FUNCREF,llvm::wasm::WASM_TYPE_I32,llvm::wasm::WASM_TYPE_I64,llvm::wasm::WASM_TYPE_NONNULLABLE,llvm::wasm::WASM_TYPE_NULLABLE, andllvm::wasm::WASM_TYPE_V128.

Referenced byreadInitExpr(), andreadTableType().

◆ readFloat32()

static int32_t readFloat32(WasmObjectFile::ReadContextCtx)
static

Definition at line94 of fileWasmObjectFile.cpp.

Referencesllvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr, andllvm::report_fatal_error().

Referenced byreadInitExpr().

◆ readFloat64()

static int64_t readFloat64(WasmObjectFile::ReadContextCtx)
static

Definition at line103 of fileWasmObjectFile.cpp.

Referencesllvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr, andllvm::report_fatal_error().

Referenced byreadInitExpr().

◆ readInitExpr()

staticError readInitExpr(wasm::WasmInitExprExpr,
WasmObjectFile::ReadContextCtx 
)
static

Definition at line196 of fileWasmObjectFile.cpp.

Referencesllvm::wasm::WasmInitExpr::Body,llvm::wasm::WasmInitExpr::Extended,llvm::wasm::WasmInitExprMVP::Float32,llvm::wasm::WasmInitExprMVP::Float64,llvm::wasm::WasmInitExprMVP::Global,llvm::wasm::WasmInitExpr::Inst,llvm::wasm::WasmInitExprMVP::Int32,llvm::wasm::WasmInitExprMVP::Int64,llvm::wasm::WasmInitExprMVP::Opcode,llvm::object::parse_failed,parseValType(),llvm::object::WasmObjectFile::ReadContext::Ptr,readFloat32(),readFloat64(),readOpcode(),readULEB128(),readVarint32(),readVarint64(),readVaruint32(),llvm::Error::success(),llvm::wasm::WasmInitExprMVP::Value,llvm::wasm::WASM_OPCODE_ARRAY_NEW,llvm::wasm::WASM_OPCODE_ARRAY_NEW_DEFAULT,llvm::wasm::WASM_OPCODE_ARRAY_NEW_FIXED,llvm::wasm::WASM_OPCODE_END,llvm::wasm::WASM_OPCODE_F32_CONST,llvm::wasm::WASM_OPCODE_F64_CONST,llvm::wasm::WASM_OPCODE_GC_PREFIX,llvm::wasm::WASM_OPCODE_GLOBAL_GET,llvm::wasm::WASM_OPCODE_I32_ADD,llvm::wasm::WASM_OPCODE_I32_CONST,llvm::wasm::WASM_OPCODE_I32_MUL,llvm::wasm::WASM_OPCODE_I32_SUB,llvm::wasm::WASM_OPCODE_I64_ADD,llvm::wasm::WASM_OPCODE_I64_CONST,llvm::wasm::WASM_OPCODE_I64_MUL,llvm::wasm::WASM_OPCODE_I64_SUB,llvm::wasm::WASM_OPCODE_REF_FUNC,llvm::wasm::WASM_OPCODE_REF_I31,llvm::wasm::WASM_OPCODE_REF_NULL,llvm::wasm::WASM_OPCODE_STRUCT_NEW, andllvm::wasm::WASM_OPCODE_STRUCT_NEW_DEFAULT.

◆ readLEB128()

static int64_t readLEB128(WasmObjectFile::ReadContextCtx)
static

Definition at line132 of fileWasmObjectFile.cpp.

Referencesllvm::decodeSLEB128(),llvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr, andllvm::report_fatal_error().

Referenced byreadVarint32(),readVarint64(), andreadVaruint1().

◆ readLimits()

staticwasm::WasmLimits readLimits(WasmObjectFile::ReadContextCtx)
static

Definition at line288 of fileWasmObjectFile.cpp.

ReferencesreadVaruint32(),readVaruint64(), andllvm::wasm::WASM_LIMITS_FLAG_HAS_MAX.

Referenced byreadTableType().

◆ readOpcode()

staticuint8_t readOpcode(WasmObjectFile::ReadContextCtx)
static

Definition at line171 of fileWasmObjectFile.cpp.

ReferencesreadUint8().

Referenced byreadInitExpr().

◆ readSection()

staticError readSection(WasmSectionSection,
WasmObjectFile::ReadContextCtx,
WasmSectionOrderCheckerChecker 
)
static

Definition at line305 of fileWasmObjectFile.cpp.

Referencesllvm::dbgs(),llvm::object::WasmObjectFile::ReadContext::End,LLVM_DEBUG,llvm::object::parse_failed,llvm::object::WasmObjectFile::ReadContext::Ptr,readString(),readUint8(),readVaruint32(),Size,llvm::object::WasmObjectFile::ReadContext::Start,llvm::Error::success(),llvm::to_string(), andllvm::wasm::WASM_SEC_CUSTOM.

Referenced byllvm::object::WasmObjectFile::WasmObjectFile().

◆ readString()

staticStringRef readString(WasmObjectFile::ReadContextCtx)
static

Definition at line122 of fileWasmObjectFile.cpp.

Referencesllvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr,readULEB128(), andllvm::report_fatal_error().

Referenced byreadSection().

◆ readTableType()

staticwasm::WasmTableType readTableType(WasmObjectFile::ReadContextCtx)
static

Definition at line297 of fileWasmObjectFile.cpp.

Referencesllvm::wasm::WasmTableType::ElemType,llvm::wasm::WasmTableType::Limits,parseValType(),readLimits(), andreadVaruint32().

◆ readUint32()

staticuint32_t readUint32(WasmObjectFile::ReadContextCtx)
static

Definition at line86 of fileWasmObjectFile.cpp.

Referencesllvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr,llvm::support::endian::read32le(), andllvm::report_fatal_error().

Referenced byllvm::object::WasmObjectFile::WasmObjectFile().

◆ readUint8()

staticuint8_t readUint8(WasmObjectFile::ReadContextCtx)
static

Definition at line80 of fileWasmObjectFile.cpp.

Referencesllvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr, andllvm::report_fatal_error().

Referenced byreadOpcode(), andreadSection().

◆ readULEB128()

staticuint64_t readULEB128(WasmObjectFile::ReadContextCtx)
static

Definition at line112 of fileWasmObjectFile.cpp.

Referencesllvm::decodeULEB128(),llvm::object::WasmObjectFile::ReadContext::End,llvm::object::WasmObjectFile::ReadContext::Ptr, andllvm::report_fatal_error().

Referenced byreadInitExpr(),readString(),readVaruint32(), andreadVaruint64().

◆ readVarint32()

static int32_t readVarint32(WasmObjectFile::ReadContextCtx)
static

Definition at line149 of fileWasmObjectFile.cpp.

ReferencesreadLEB128(), andllvm::report_fatal_error().

Referenced byreadInitExpr().

◆ readVarint64()

static int64_t readVarint64(WasmObjectFile::ReadContextCtx)
static

Definition at line163 of fileWasmObjectFile.cpp.

ReferencesreadLEB128().

Referenced byparseValType(), andreadInitExpr().

◆ readVaruint1()

staticuint8_t readVaruint1(WasmObjectFile::ReadContextCtx)
static

Definition at line142 of fileWasmObjectFile.cpp.

ReferencesreadLEB128(),llvm::report_fatal_error(), andVARUINT1_MAX.

◆ readVaruint32()

staticuint32_t readVaruint32(WasmObjectFile::ReadContextCtx)
static

Definition at line156 of fileWasmObjectFile.cpp.

ReferencesreadULEB128(), andllvm::report_fatal_error().

Referenced byreadInitExpr(),readLimits(),readSection(), andreadTableType().

◆ readVaruint64()

staticuint64_t readVaruint64(WasmObjectFile::ReadContextCtx)
static

Definition at line167 of fileWasmObjectFile.cpp.

ReferencesreadULEB128().

Referenced byreadLimits().


Generated on Sun Jul 20 2025 15:03:10 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp