LLVM  10.0.0svn
Classes | Enumerations | Functions | Variables
llvm::wasm Namespace Reference

Classes

struct  WasmDataReference
 
struct  WasmDataSegment
 
struct  WasmDylinkInfo
 
struct  WasmElemSegment
 
struct  WasmEvent
 
struct  WasmEventType
 
struct  WasmExport
 
struct  WasmFeatureEntry
 
struct  WasmFunction
 
struct  WasmFunctionName
 
struct  WasmGlobal
 
struct  WasmGlobalType
 
struct  WasmImport
 
struct  WasmInitExpr
 
struct  WasmInitFunc
 
struct  WasmLimits
 
struct  WasmLinkingData
 
struct  WasmLocalDecl
 
struct  WasmObjectHeader
 
struct  WasmProducerInfo
 
struct  WasmRelocation
 
struct  WasmSignature
 
struct  WasmSymbolInfo
 
struct  WasmTable
 

Enumerations

enum  : unsigned {
  WASM_SEC_CUSTOM = 0, WASM_SEC_TYPE = 1, WASM_SEC_IMPORT = 2, WASM_SEC_FUNCTION = 3,
  WASM_SEC_TABLE = 4, WASM_SEC_MEMORY = 5, WASM_SEC_GLOBAL = 6, WASM_SEC_EXPORT = 7,
  WASM_SEC_START = 8, WASM_SEC_ELEM = 9, WASM_SEC_CODE = 10, WASM_SEC_DATA = 11,
  WASM_SEC_DATACOUNT = 12, WASM_SEC_EVENT = 13
}
 
enum  : unsigned {
  WASM_TYPE_I32 = 0x7F, WASM_TYPE_I64 = 0x7E, WASM_TYPE_F32 = 0x7D, WASM_TYPE_F64 = 0x7C,
  WASM_TYPE_V128 = 0x7B, WASM_TYPE_FUNCREF = 0x70, WASM_TYPE_EXNREF = 0x68, WASM_TYPE_FUNC = 0x60,
  WASM_TYPE_NORESULT = 0x40
}
 
enum  : unsigned {
  WASM_EXTERNAL_FUNCTION = 0x0, WASM_EXTERNAL_TABLE = 0x1, WASM_EXTERNAL_MEMORY = 0x2, WASM_EXTERNAL_GLOBAL = 0x3,
  WASM_EXTERNAL_EVENT = 0x4
}
 
enum  : unsigned {
  WASM_OPCODE_END = 0x0b, WASM_OPCODE_CALL = 0x10, WASM_OPCODE_LOCAL_GET = 0x20, WASM_OPCODE_GLOBAL_GET = 0x23,
  WASM_OPCODE_GLOBAL_SET = 0x24, WASM_OPCODE_I32_STORE = 0x36, WASM_OPCODE_I32_CONST = 0x41, WASM_OPCODE_I64_CONST = 0x42,
  WASM_OPCODE_F32_CONST = 0x43, WASM_OPCODE_F64_CONST = 0x44, WASM_OPCODE_I32_ADD = 0x6a
}
 
enum  : unsigned {
  WASM_OPCODE_IF = 0x04, WASM_OPCODE_ELSE = 0x05, WASM_OPCODE_DROP = 0x1a, WASM_OPCODE_MISC_PREFIX = 0xfc,
  WASM_OPCODE_MEMORY_INIT = 0x08, WASM_OPCODE_DATA_DROP = 0x09, WASM_OPCODE_ATOMICS_PREFIX = 0xfe, WASM_OPCODE_ATOMIC_NOTIFY = 0x00,
  WASM_OPCODE_I32_ATOMIC_WAIT = 0x01, WASM_OPCODE_I32_ATOMIC_STORE = 0x17, WASM_OPCODE_I32_RMW_CMPXCHG = 0x48
}
 
enum  : unsigned { WASM_LIMITS_FLAG_HAS_MAX = 0x1, WASM_LIMITS_FLAG_IS_SHARED = 0x2 }
 
enum  : unsigned { WASM_SEGMENT_IS_PASSIVE = 0x01, WASM_SEGMENT_HAS_MEMINDEX = 0x02 }
 
enum  : uint8_t { WASM_FEATURE_PREFIX_USED = '+', WASM_FEATURE_PREFIX_REQUIRED = '=', WASM_FEATURE_PREFIX_DISALLOWED = '-' }
 
enum  : unsigned { WASM_NAMES_FUNCTION = 0x1, WASM_NAMES_LOCAL = 0x2 }
 
enum  : unsigned { WASM_SEGMENT_INFO = 0x5, WASM_INIT_FUNCS = 0x6, WASM_COMDAT_INFO = 0x7, WASM_SYMBOL_TABLE = 0x8 }
 
enum  : unsigned { WASM_COMDAT_DATA = 0x0, WASM_COMDAT_FUNCTION = 0x1 }
 
enum  WasmSymbolType : unsigned {
  WASM_SYMBOL_TYPE_FUNCTION = 0x0, WASM_SYMBOL_TYPE_DATA = 0x1, WASM_SYMBOL_TYPE_GLOBAL = 0x2, WASM_SYMBOL_TYPE_SECTION = 0x3,
  WASM_SYMBOL_TYPE_EVENT = 0x4
}
 
enum  WasmEventAttribute : unsigned { WASM_EVENT_ATTRIBUTE_EXCEPTION = 0x0 }
 
enum  : unsigned
 
enum  ValType {
  ValType::I32 = WASM_TYPE_I32, ValType::I64 = WASM_TYPE_I64, ValType::F32 = WASM_TYPE_F32, ValType::F64 = WASM_TYPE_F64,
  ValType::V128 = WASM_TYPE_V128, ValType::EXNREF = WASM_TYPE_EXNREF
}
 

Functions

bool operator== (const WasmSignature &LHS, const WasmSignature &RHS)
 
bool operator!= (const WasmSignature &LHS, const WasmSignature &RHS)
 
bool operator== (const WasmGlobalType &LHS, const WasmGlobalType &RHS)
 
bool operator!= (const WasmGlobalType &LHS, const WasmGlobalType &RHS)
 
std::string toString (WasmSymbolType type)
 
std::string relocTypetoString (uint32_t type)
 
bool relocTypeHasAddend (uint32_t type)
 

Variables

const char WasmMagic [] = {'\0', 'a', 's', 'm'}
 
const uint32_t WasmVersion = 0x1
 
const uint32_t WasmMetadataVersion = 0x2
 
const uint32_t WasmPageSize = 65536
 
const unsigned WASM_SYMBOL_BINDING_MASK = 0x3
 
const unsigned WASM_SYMBOL_VISIBILITY_MASK = 0xc
 
const unsigned WASM_SYMBOL_BINDING_GLOBAL = 0x0
 
const unsigned WASM_SYMBOL_BINDING_WEAK = 0x1
 
const unsigned WASM_SYMBOL_BINDING_LOCAL = 0x2
 
const unsigned WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0
 
const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4
 
const unsigned WASM_SYMBOL_UNDEFINED = 0x10
 
const unsigned WASM_SYMBOL_EXPORTED = 0x20
 
const unsigned WASM_SYMBOL_EXPLICIT_NAME = 0x40
 
const unsigned WASM_SYMBOL_NO_STRIP = 0x80
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_SEC_CUSTOM 
WASM_SEC_TYPE 
WASM_SEC_IMPORT 
WASM_SEC_FUNCTION 
WASM_SEC_TABLE 
WASM_SEC_MEMORY 
WASM_SEC_GLOBAL 
WASM_SEC_EXPORT 
WASM_SEC_START 
WASM_SEC_ELEM 
WASM_SEC_CODE 
WASM_SEC_DATA 
WASM_SEC_DATACOUNT 
WASM_SEC_EVENT 

Definition at line 203 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_TYPE_I32 
WASM_TYPE_I64 
WASM_TYPE_F32 
WASM_TYPE_F64 
WASM_TYPE_V128 
WASM_TYPE_FUNCREF 
WASM_TYPE_EXNREF 
WASM_TYPE_FUNC 
WASM_TYPE_NORESULT 

Definition at line 221 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_EXTERNAL_FUNCTION 
WASM_EXTERNAL_TABLE 
WASM_EXTERNAL_MEMORY 
WASM_EXTERNAL_GLOBAL 
WASM_EXTERNAL_EVENT 

Definition at line 234 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_OPCODE_END 
WASM_OPCODE_CALL 
WASM_OPCODE_LOCAL_GET 
WASM_OPCODE_GLOBAL_GET 
WASM_OPCODE_GLOBAL_SET 
WASM_OPCODE_I32_STORE 
WASM_OPCODE_I32_CONST 
WASM_OPCODE_I64_CONST 
WASM_OPCODE_F32_CONST 
WASM_OPCODE_F64_CONST 
WASM_OPCODE_I32_ADD 

Definition at line 243 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_OPCODE_IF 
WASM_OPCODE_ELSE 
WASM_OPCODE_DROP 
WASM_OPCODE_MISC_PREFIX 
WASM_OPCODE_MEMORY_INIT 
WASM_OPCODE_DATA_DROP 
WASM_OPCODE_ATOMICS_PREFIX 
WASM_OPCODE_ATOMIC_NOTIFY 
WASM_OPCODE_I32_ATOMIC_WAIT 
WASM_OPCODE_I32_ATOMIC_STORE 
WASM_OPCODE_I32_RMW_CMPXCHG 

Definition at line 258 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_LIMITS_FLAG_HAS_MAX 
WASM_LIMITS_FLAG_IS_SHARED 

Definition at line 272 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_SEGMENT_IS_PASSIVE 
WASM_SEGMENT_HAS_MEMINDEX 

Definition at line 277 of file Wasm.h.

◆ anonymous enum

anonymous enum : uint8_t
Enumerator
WASM_FEATURE_PREFIX_USED 
WASM_FEATURE_PREFIX_REQUIRED 
WASM_FEATURE_PREFIX_DISALLOWED 

Definition at line 283 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_NAMES_FUNCTION 
WASM_NAMES_LOCAL 

Definition at line 290 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_SEGMENT_INFO 
WASM_INIT_FUNCS 
WASM_COMDAT_INFO 
WASM_SYMBOL_TABLE 

Definition at line 296 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned
Enumerator
WASM_COMDAT_DATA 
WASM_COMDAT_FUNCTION 

Definition at line 304 of file Wasm.h.

◆ anonymous enum

anonymous enum : unsigned

Definition at line 338 of file Wasm.h.

◆ ValType

enum llvm::wasm::ValType
strong
Enumerator
I32 
I64 
F32 
F64 
V128 
EXNREF 

Definition at line 345 of file Wasm.h.

◆ WasmEventAttribute

Enumerator
WASM_EVENT_ATTRIBUTE_EXCEPTION 

Definition at line 319 of file Wasm.h.

◆ WasmSymbolType

Enumerator
WASM_SYMBOL_TYPE_FUNCTION 
WASM_SYMBOL_TYPE_DATA 
WASM_SYMBOL_TYPE_GLOBAL 
WASM_SYMBOL_TYPE_SECTION 
WASM_SYMBOL_TYPE_EVENT 

Definition at line 310 of file Wasm.h.

Function Documentation

◆ operator!=() [1/2]

bool llvm::wasm::operator!= ( const WasmSignature LHS,
const WasmSignature RHS 
)
inline

Definition at line 372 of file Wasm.h.

◆ operator!=() [2/2]

bool llvm::wasm::operator!= ( const WasmGlobalType LHS,
const WasmGlobalType RHS 
)
inline

Definition at line 380 of file Wasm.h.

References relocTypeHasAddend(), relocTypetoString(), and toString().

◆ operator==() [1/2]

bool llvm::wasm::operator== ( const WasmSignature LHS,
const WasmSignature RHS 
)
inline

◆ operator==() [2/2]

bool llvm::wasm::operator== ( const WasmGlobalType LHS,
const WasmGlobalType RHS 
)
inline

◆ relocTypeHasAddend()

bool llvm::wasm::relocTypeHasAddend ( uint32_t  type)

Definition at line 39 of file Wasm.cpp.

Referenced by operator!=().

◆ relocTypetoString()

std::string llvm::wasm::relocTypetoString ( uint32_t  type)

Definition at line 27 of file Wasm.cpp.

References llvm_unreachable.

Referenced by operator!=().

◆ toString()

std::string llvm::wasm::toString ( wasm::WasmSymbolType  Type)

Variable Documentation

◆ WASM_SYMBOL_BINDING_GLOBAL

const unsigned llvm::wasm::WASM_SYMBOL_BINDING_GLOBAL = 0x0

Definition at line 326 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::isBindingGlobal().

◆ WASM_SYMBOL_BINDING_LOCAL

const unsigned llvm::wasm::WASM_SYMBOL_BINDING_LOCAL = 0x2

Definition at line 328 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::isBindingLocal(), and isInSymtab().

◆ WASM_SYMBOL_BINDING_MASK

const unsigned llvm::wasm::WASM_SYMBOL_BINDING_MASK = 0x3

Definition at line 323 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::getBinding().

◆ WASM_SYMBOL_BINDING_WEAK

const unsigned llvm::wasm::WASM_SYMBOL_BINDING_WEAK = 0x1

Definition at line 327 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::isBindingWeak(), and isInSymtab().

◆ WASM_SYMBOL_EXPLICIT_NAME

const unsigned llvm::wasm::WASM_SYMBOL_EXPLICIT_NAME = 0x40

Definition at line 333 of file Wasm.h.

Referenced by addData(), isInSymtab(), and writeLimits().

◆ WASM_SYMBOL_EXPORTED

const unsigned llvm::wasm::WASM_SYMBOL_EXPORTED = 0x20

◆ WASM_SYMBOL_NO_STRIP

const unsigned llvm::wasm::WASM_SYMBOL_NO_STRIP = 0x80

◆ WASM_SYMBOL_UNDEFINED

const unsigned llvm::wasm::WASM_SYMBOL_UNDEFINED = 0x10

◆ WASM_SYMBOL_VISIBILITY_DEFAULT

const unsigned llvm::wasm::WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0

Definition at line 329 of file Wasm.h.

◆ WASM_SYMBOL_VISIBILITY_HIDDEN

const unsigned llvm::wasm::WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4

Definition at line 330 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::isHidden(), and isInSymtab().

◆ WASM_SYMBOL_VISIBILITY_MASK

const unsigned llvm::wasm::WASM_SYMBOL_VISIBILITY_MASK = 0xc

Definition at line 324 of file Wasm.h.

Referenced by llvm::object::WasmSymbol::getVisibility().

◆ WasmMagic

const char llvm::wasm::WasmMagic[] = {'\0', 'a', 's', 'm'}

Definition at line 25 of file Wasm.h.

Referenced by writeLimits().

◆ WasmMetadataVersion

const uint32_t llvm::wasm::WasmMetadataVersion = 0x2

Definition at line 29 of file Wasm.h.

Referenced by addData().

◆ WasmPageSize

const uint32_t llvm::wasm::WasmPageSize = 65536

Definition at line 31 of file Wasm.h.

Referenced by addData().

◆ WasmVersion

const uint32_t llvm::wasm::WasmVersion = 0x1

Definition at line 27 of file Wasm.h.