LLVM 20.0.0git
|
#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) |
#define DEBUG_TYPE "wasm-object" |
Definition at line 32 of file WasmObjectFile.cpp.
#define VARINT7_MAX ((1 << 7) - 1) |
Definition at line 75 of file WasmObjectFile.cpp.
#define VARINT7_MIN (-(1 << 7)) |
Definition at line 76 of file WasmObjectFile.cpp.
#define VARUINT1_MAX (1) |
Definition at line 78 of file WasmObjectFile.cpp.
#define VARUINT7_MAX (1 << 7) |
Definition at line 77 of file WasmObjectFile.cpp.
|
static |
Definition at line 175 of file WasmObjectFile.cpp.
References llvm::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, and llvm::wasm::WASM_TYPE_V128.
Referenced by readInitExpr(), and readTableType().
|
static |
Definition at line 94 of file WasmObjectFile.cpp.
References llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 103 of file WasmObjectFile.cpp.
References llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 196 of file WasmObjectFile.cpp.
References llvm::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, and llvm::wasm::WASM_OPCODE_STRUCT_NEW_DEFAULT.
|
static |
Definition at line 132 of file WasmObjectFile.cpp.
References llvm::decodeSLEB128(), llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, and llvm::report_fatal_error().
Referenced by readVarint32(), readVarint64(), and readVaruint1().
|
static |
Definition at line 288 of file WasmObjectFile.cpp.
References readVaruint32(), readVaruint64(), and llvm::wasm::WASM_LIMITS_FLAG_HAS_MAX.
Referenced by readTableType().
|
static |
Definition at line 171 of file WasmObjectFile.cpp.
References readUint8().
Referenced by readInitExpr().
|
static |
Definition at line 305 of file WasmObjectFile.cpp.
References llvm::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(), and llvm::wasm::WASM_SEC_CUSTOM.
Referenced by llvm::object::WasmObjectFile::WasmObjectFile().
|
static |
Definition at line 122 of file WasmObjectFile.cpp.
References llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, readULEB128(), and llvm::report_fatal_error().
Referenced by readSection().
|
static |
Definition at line 297 of file WasmObjectFile.cpp.
References llvm::wasm::WasmTableType::ElemType, llvm::wasm::WasmTableType::Limits, parseValType(), readLimits(), and readVaruint32().
|
static |
Definition at line 86 of file WasmObjectFile.cpp.
References llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, llvm::support::endian::read32le(), and llvm::report_fatal_error().
Referenced by llvm::object::WasmObjectFile::WasmObjectFile().
|
static |
Definition at line 80 of file WasmObjectFile.cpp.
References llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, and llvm::report_fatal_error().
Referenced by readOpcode(), and readSection().
|
static |
Definition at line 112 of file WasmObjectFile.cpp.
References llvm::decodeULEB128(), llvm::object::WasmObjectFile::ReadContext::End, llvm::object::WasmObjectFile::ReadContext::Ptr, and llvm::report_fatal_error().
Referenced by readInitExpr(), readString(), readVaruint32(), and readVaruint64().
|
static |
Definition at line 149 of file WasmObjectFile.cpp.
References readLEB128(), and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 163 of file WasmObjectFile.cpp.
References readLEB128().
Referenced by parseValType(), and readInitExpr().
|
static |
Definition at line 142 of file WasmObjectFile.cpp.
References readLEB128(), llvm::report_fatal_error(), and VARUINT1_MAX.
|
static |
Definition at line 156 of file WasmObjectFile.cpp.
References readULEB128(), and llvm::report_fatal_error().
Referenced by readInitExpr(), readLimits(), readSection(), and readTableType().
|
static |
Definition at line 167 of file WasmObjectFile.cpp.
References readULEB128().
Referenced by readLimits().