LLVM  5.0.0
Macros | Functions
WasmObjectFile.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.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 <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <system_error>
#include "llvm/BinaryFormat/WasmRelocs/WebAssembly.def"
Include dependency graph for WasmObjectFile.cpp:

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 (const uint8_t *&Ptr)
 
static uint32_t readUint32 (const uint8_t *&Ptr)
 
static int32_t readFloat32 (const uint8_t *&Ptr)
 
static int64_t readFloat64 (const uint8_t *&Ptr)
 
static uint64_t readULEB128 (const uint8_t *&Ptr)
 
static StringRef readString (const uint8_t *&Ptr)
 
static int64_t readLEB128 (const uint8_t *&Ptr)
 
static uint8_t readVaruint1 (const uint8_t *&Ptr)
 
static int8_t readVarint7 (const uint8_t *&Ptr)
 
static uint8_t readVaruint7 (const uint8_t *&Ptr)
 
static int32_t readVarint32 (const uint8_t *&Ptr)
 
static uint32_t readVaruint32 (const uint8_t *&Ptr)
 
static int64_t readVarint64 (const uint8_t *&Ptr)
 
static uint8_t readOpcode (const uint8_t *&Ptr)
 
static Error readInitExpr (wasm::WasmInitExpr &Expr, const uint8_t *&Ptr)
 
static wasm::WasmLimits readLimits (const uint8_t *&Ptr)
 
static wasm::WasmTable readTable (const uint8_t *&Ptr)
 
static Error readSection (WasmSection &Section, const uint8_t *&Ptr, const uint8_t *Start)
 

Macro Definition Documentation

#define DEBUG_TYPE   "wasm-object"

Definition at line 31 of file WasmObjectFile.cpp.

#define ECase (   X)
Value:
case wasm::WASM_SEC_##X: \
Res = #X; \
break
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")

Referenced by llvm::object::WasmObjectFile::getSectionName().

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

Definition at line 46 of file WasmObjectFile.cpp.

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

Definition at line 47 of file WasmObjectFile.cpp.

Referenced by readVarint7().

#define VARUINT1_MAX   (1)

Definition at line 49 of file WasmObjectFile.cpp.

#define VARUINT7_MAX   (1<<7)

Definition at line 48 of file WasmObjectFile.cpp.

Referenced by readVaruint7().

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

Function Documentation

static int32_t readFloat32 ( const uint8_t *&  Ptr)
static

Definition at line 59 of file WasmObjectFile.cpp.

Referenced by readInitExpr().

static int64_t readFloat64 ( const uint8_t *&  Ptr)
static

Definition at line 66 of file WasmObjectFile.cpp.

Referenced by readInitExpr().

static Error readInitExpr ( wasm::WasmInitExpr &  Expr,
const uint8_t *&  Ptr 
)
static
static int64_t readLEB128 ( const uint8_t *&  Ptr)
static

Definition at line 87 of file WasmObjectFile.cpp.

References llvm::decodeSLEB128().

Referenced by readVarint32(), readVarint64(), readVarint7(), and readVaruint1().

static wasm::WasmLimits readLimits ( const uint8_t *&  Ptr)
static
static uint8_t readOpcode ( const uint8_t *&  Ptr)
static

Definition at line 128 of file WasmObjectFile.cpp.

References readUint8().

Referenced by readInitExpr().

static Error readSection ( WasmSection &  Section,
const uint8_t *&  Ptr,
const uint8_t *  Start 
)
static
static StringRef readString ( const uint8_t *&  Ptr)
static
static wasm::WasmTable readTable ( const uint8_t *&  Ptr)
static
static uint32_t readUint32 ( const uint8_t *&  Ptr)
static
static uint8_t readUint8 ( const uint8_t *&  Ptr)
static

Definition at line 51 of file WasmObjectFile.cpp.

Referenced by readOpcode().

static uint64_t readULEB128 ( const uint8_t *&  Ptr)
static
static int32_t readVarint32 ( const uint8_t *&  Ptr)
static

Definition at line 112 of file WasmObjectFile.cpp.

References assert(), and readLEB128().

Referenced by readInitExpr().

static int64_t readVarint64 ( const uint8_t *&  Ptr)
static

Definition at line 124 of file WasmObjectFile.cpp.

References readLEB128().

Referenced by readInitExpr().

static int8_t readVarint7 ( const uint8_t *&  Ptr)
static

Definition at line 100 of file WasmObjectFile.cpp.

References assert(), readLEB128(), and VARINT7_MIN.

Referenced by readTable().

static uint8_t readVaruint1 ( const uint8_t *&  Ptr)
static

Definition at line 94 of file WasmObjectFile.cpp.

References assert(), and readLEB128().

Referenced by readLimits().

static uint32_t readVaruint32 ( const uint8_t *&  Ptr)
static

Definition at line 118 of file WasmObjectFile.cpp.

References assert(), and readULEB128().

Referenced by readLimits(), and readSection().

static uint8_t readVaruint7 ( const uint8_t *&  Ptr)
static

Definition at line 106 of file WasmObjectFile.cpp.

References assert(), readULEB128(), and VARUINT7_MAX.

Referenced by readSection().