LLVM
8.0.1
|
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Triple.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/MC/SubtargetFeature.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 <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <system_error>
#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 | ECase(X) |
#define | WASM_RELOC(name, value) |
Functions | |
static uint8_t | readUint8 (WasmObjectFile::ReadContext &Ctx) |
static uint32_t | readUint32 (WasmObjectFile::ReadContext &Ctx) |
static int32_t | readFloat32 (WasmObjectFile::ReadContext &Ctx) |
static int64_t | readFloat64 (WasmObjectFile::ReadContext &Ctx) |
static uint64_t | readULEB128 (WasmObjectFile::ReadContext &Ctx) |
static StringRef | readString (WasmObjectFile::ReadContext &Ctx) |
static int64_t | readLEB128 (WasmObjectFile::ReadContext &Ctx) |
static uint8_t | readVaruint1 (WasmObjectFile::ReadContext &Ctx) |
static int32_t | readVarint32 (WasmObjectFile::ReadContext &Ctx) |
static uint32_t | readVaruint32 (WasmObjectFile::ReadContext &Ctx) |
static int64_t | readVarint64 (WasmObjectFile::ReadContext &Ctx) |
static uint8_t | readOpcode (WasmObjectFile::ReadContext &Ctx) |
static Error | readInitExpr (wasm::WasmInitExpr &Expr, WasmObjectFile::ReadContext &Ctx) |
static wasm::WasmLimits | readLimits (WasmObjectFile::ReadContext &Ctx) |
static wasm::WasmTable | readTable (WasmObjectFile::ReadContext &Ctx) |
static Error | readSection (WasmSection &Section, WasmObjectFile::ReadContext &Ctx, WasmSectionOrderChecker &Checker) |
#define DEBUG_TYPE "wasm-object" |
Definition at line 34 of file WasmObjectFile.cpp.
#define ECase | ( | X | ) |
Referenced by llvm::object::WasmObjectFile::getSectionName().
#define VARINT7_MAX ((1 << 7) - 1) |
Definition at line 66 of file WasmObjectFile.cpp.
#define VARINT7_MIN (-(1 << 7)) |
Definition at line 67 of file WasmObjectFile.cpp.
#define VARUINT1_MAX (1) |
Definition at line 69 of file WasmObjectFile.cpp.
Referenced by readVaruint1().
#define VARUINT7_MAX (1 << 7) |
Definition at line 68 of file WasmObjectFile.cpp.
#define WASM_RELOC | ( | name, | |
value | |||
) |
|
static |
Definition at line 85 of file WasmObjectFile.cpp.
References llvm::Intrinsic::memcpy, and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 94 of file WasmObjectFile.cpp.
References llvm::Intrinsic::memcpy, and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 162 of file WasmObjectFile.cpp.
References llvm::wasm::WasmInitExpr::Float32, llvm::wasm::WasmInitExpr::Float64, llvm::wasm::WasmInitExpr::Global, llvm::wasm::WasmInitExpr::Int32, llvm::wasm::WasmInitExpr::Int64, llvm::wasm::WasmInitExpr::Opcode, llvm::object::parse_failed, readFloat32(), readFloat64(), readOpcode(), readULEB128(), readVarint32(), readVarint64(), llvm::Error::success(), llvm::wasm::WasmInitExpr::Value, llvm::wasm::WASM_OPCODE_END, llvm::wasm::WASM_OPCODE_F32_CONST, llvm::wasm::WASM_OPCODE_F64_CONST, llvm::wasm::WASM_OPCODE_GLOBAL_GET, llvm::wasm::WASM_OPCODE_I32_CONST, and llvm::wasm::WASM_OPCODE_I64_CONST.
|
static |
Definition at line 123 of file WasmObjectFile.cpp.
References llvm::decodeSLEB128(), and llvm::report_fatal_error().
Referenced by readVarint32(), readVarint64(), and readVaruint1().
|
static |
Definition at line 195 of file WasmObjectFile.cpp.
References llvm::wasm::WasmLimits::Flags, llvm::wasm::WasmLimits::Initial, llvm::wasm::WasmLimits::Maximum, readVaruint32(), and llvm::wasm::WASM_LIMITS_FLAG_HAS_MAX.
Referenced by readTable().
|
static |
Definition at line 158 of file WasmObjectFile.cpp.
References readUint8().
Referenced by readInitExpr().
|
static |
Definition at line 211 of file WasmObjectFile.cpp.
References llvm::dbgs(), LLVM_DEBUG, llvm::object::parse_failed, readString(), readUint8(), readVaruint32(), Size, llvm::Error::success(), llvm::to_string(), and llvm::wasm::WASM_SEC_CUSTOM.
|
static |
Definition at line 113 of file WasmObjectFile.cpp.
References readULEB128(), llvm::report_fatal_error(), and llvm::MCID::Return.
Referenced by llvm::coverage::RawCoverageReader::RawCoverageReader(), llvm::sampleprof::SampleProfileReaderCompactBinary::read(), readSection(), llvm::sampleprof::SampleProfileReaderBinary::SampleProfileReaderBinary(), and llvm::sampleprof::SampleProfileReaderGCC::SampleProfileReaderGCC().
|
static |
Definition at line 204 of file WasmObjectFile.cpp.
References llvm::wasm::WasmTable::ElemType, llvm::wasm::WasmTable::Limits, readLimits(), and readUint8().
|
static |
Definition at line 77 of file WasmObjectFile.cpp.
References llvm::support::endian::read32le(), and llvm::report_fatal_error().
|
static |
Definition at line 71 of file WasmObjectFile.cpp.
References llvm::report_fatal_error().
Referenced by readOpcode(), readSection(), and readTable().
|
static |
Definition at line 103 of file WasmObjectFile.cpp.
References llvm::decodeULEB128(), and llvm::report_fatal_error().
Referenced by llvm::object::MachORebaseEntry::moveNext(), llvm::object::MachOBindEntry::moveNext(), llvm::coverage::RawCoverageReader::RawCoverageReader(), readInitExpr(), readString(), and readVaruint32().
|
static |
Definition at line 140 of file WasmObjectFile.cpp.
References readLEB128(), and llvm::report_fatal_error().
Referenced by readInitExpr().
|
static |
Definition at line 154 of file WasmObjectFile.cpp.
References readLEB128().
Referenced by readInitExpr().
|
static |
Definition at line 133 of file WasmObjectFile.cpp.
References readLEB128(), llvm::report_fatal_error(), and VARUINT1_MAX.
|
static |
Definition at line 147 of file WasmObjectFile.cpp.
References readULEB128(), and llvm::report_fatal_error().
Referenced by readLimits(), and readSection().