LLVM 20.0.0git
Classes | Namespaces | Macros | Enumerations | Functions | Variables
Wasm.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include <optional>
#include "WasmRelocs.def"

Go to the source code of this file.

Classes

struct  llvm::wasm::WasmObjectHeader
 
struct  llvm::wasm::WasmDylinkImportInfo
 
struct  llvm::wasm::WasmDylinkExportInfo
 
struct  llvm::wasm::WasmDylinkInfo
 
struct  llvm::wasm::WasmProducerInfo
 
struct  llvm::wasm::WasmFeatureEntry
 
struct  llvm::wasm::WasmExport
 
struct  llvm::wasm::WasmLimits
 
struct  llvm::wasm::WasmTableType
 
struct  llvm::wasm::WasmTable
 
struct  llvm::wasm::WasmInitExprMVP
 
struct  llvm::wasm::WasmInitExpr
 
struct  llvm::wasm::WasmGlobalType
 
struct  llvm::wasm::WasmGlobal
 
struct  llvm::wasm::WasmTag
 
struct  llvm::wasm::WasmImport
 
struct  llvm::wasm::WasmLocalDecl
 
struct  llvm::wasm::WasmFunction
 
struct  llvm::wasm::WasmDataSegment
 
struct  llvm::wasm::WasmElemSegment
 
struct  llvm::wasm::WasmDataReference
 
struct  llvm::wasm::WasmRelocation
 
struct  llvm::wasm::WasmInitFunc
 
struct  llvm::wasm::WasmSymbolInfo
 
struct  llvm::wasm::WasmDebugName
 
struct  llvm::wasm::WasmLinkingData
 
struct  llvm::wasm::WasmSignature
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::wasm
 

Macros

#define WASM_RELOC(name, value)   name = value,
 

Enumerations

enum  : unsigned {
  llvm::wasm::WASM_SEC_CUSTOM = 0 , llvm::wasm::WASM_SEC_TYPE = 1 , llvm::wasm::WASM_SEC_IMPORT = 2 , llvm::wasm::WASM_SEC_FUNCTION = 3 ,
  llvm::wasm::WASM_SEC_TABLE = 4 , llvm::wasm::WASM_SEC_MEMORY = 5 , llvm::wasm::WASM_SEC_GLOBAL = 6 , llvm::wasm::WASM_SEC_EXPORT = 7 ,
  llvm::wasm::WASM_SEC_START = 8 , llvm::wasm::WASM_SEC_ELEM = 9 , llvm::wasm::WASM_SEC_CODE = 10 , llvm::wasm::WASM_SEC_DATA = 11 ,
  llvm::wasm::WASM_SEC_DATACOUNT = 12 , llvm::wasm::WASM_SEC_TAG = 13 , llvm::wasm::WASM_SEC_LAST_KNOWN = WASM_SEC_TAG
}
 
enum  : unsigned {
  llvm::wasm::WASM_TYPE_I32 = 0x7F , llvm::wasm::WASM_TYPE_I64 = 0x7E , llvm::wasm::WASM_TYPE_F32 = 0x7D , llvm::wasm::WASM_TYPE_F64 = 0x7C ,
  llvm::wasm::WASM_TYPE_V128 = 0x7B , llvm::wasm::WASM_TYPE_NULLFUNCREF = 0x73 , llvm::wasm::WASM_TYPE_NULLEXTERNREF = 0x72 , llvm::wasm::WASM_TYPE_NULLEXNREF = 0x74 ,
  llvm::wasm::WASM_TYPE_NULLREF = 0x71 , llvm::wasm::WASM_TYPE_FUNCREF = 0x70 , llvm::wasm::WASM_TYPE_EXTERNREF = 0x6F , llvm::wasm::WASM_TYPE_EXNREF = 0x69 ,
  llvm::wasm::WASM_TYPE_ANYREF = 0x6E , llvm::wasm::WASM_TYPE_EQREF = 0x6D , llvm::wasm::WASM_TYPE_I31REF = 0x6C , llvm::wasm::WASM_TYPE_STRUCTREF = 0x6B ,
  llvm::wasm::WASM_TYPE_ARRAYREF = 0x6A , llvm::wasm::WASM_TYPE_NONNULLABLE = 0x64 , llvm::wasm::WASM_TYPE_NULLABLE = 0x63 , llvm::wasm::WASM_TYPE_FUNC = 0x60 ,
  llvm::wasm::WASM_TYPE_ARRAY = 0x5E , llvm::wasm::WASM_TYPE_STRUCT = 0x5F , llvm::wasm::WASM_TYPE_SUB = 0x50 , llvm::wasm::WASM_TYPE_SUB_FINAL = 0x4F ,
  llvm::wasm::WASM_TYPE_REC = 0x4E , llvm::wasm::WASM_TYPE_NORESULT = 0x40
}
 
enum  : unsigned {
  llvm::wasm::WASM_EXTERNAL_FUNCTION = 0x0 , llvm::wasm::WASM_EXTERNAL_TABLE = 0x1 , llvm::wasm::WASM_EXTERNAL_MEMORY = 0x2 , llvm::wasm::WASM_EXTERNAL_GLOBAL = 0x3 ,
  llvm::wasm::WASM_EXTERNAL_TAG = 0x4
}
 
enum  : unsigned {
  llvm::wasm::WASM_OPCODE_END = 0x0b , llvm::wasm::WASM_OPCODE_CALL = 0x10 , llvm::wasm::WASM_OPCODE_LOCAL_GET = 0x20 , llvm::wasm::WASM_OPCODE_LOCAL_SET = 0x21 ,
  llvm::wasm::WASM_OPCODE_LOCAL_TEE = 0x22 , llvm::wasm::WASM_OPCODE_GLOBAL_GET = 0x23 , llvm::wasm::WASM_OPCODE_GLOBAL_SET = 0x24 , llvm::wasm::WASM_OPCODE_I32_STORE = 0x36 ,
  llvm::wasm::WASM_OPCODE_I64_STORE = 0x37 , llvm::wasm::WASM_OPCODE_I32_CONST = 0x41 , llvm::wasm::WASM_OPCODE_I64_CONST = 0x42 , llvm::wasm::WASM_OPCODE_F32_CONST = 0x43 ,
  llvm::wasm::WASM_OPCODE_F64_CONST = 0x44 , llvm::wasm::WASM_OPCODE_I32_ADD = 0x6a , llvm::wasm::WASM_OPCODE_I32_SUB = 0x6b , llvm::wasm::WASM_OPCODE_I32_MUL = 0x6c ,
  llvm::wasm::WASM_OPCODE_I64_ADD = 0x7c , llvm::wasm::WASM_OPCODE_I64_SUB = 0x7d , llvm::wasm::WASM_OPCODE_I64_MUL = 0x7e , llvm::wasm::WASM_OPCODE_REF_NULL = 0xd0 ,
  llvm::wasm::WASM_OPCODE_REF_FUNC = 0xd2 , llvm::wasm::WASM_OPCODE_GC_PREFIX = 0xfb
}
 
enum  : unsigned {
  llvm::wasm::WASM_OPCODE_STRUCT_NEW = 0x00 , llvm::wasm::WASM_OPCODE_STRUCT_NEW_DEFAULT = 0x01 , llvm::wasm::WASM_OPCODE_ARRAY_NEW = 0x06 , llvm::wasm::WASM_OPCODE_ARRAY_NEW_DEFAULT = 0x07 ,
  llvm::wasm::WASM_OPCODE_ARRAY_NEW_FIXED = 0x08 , llvm::wasm::WASM_OPCODE_REF_I31 = 0x1c
}
 
enum  : unsigned {
  llvm::wasm::WASM_OPCODE_BLOCK = 0x02 , llvm::wasm::WASM_OPCODE_BR = 0x0c , llvm::wasm::WASM_OPCODE_BR_TABLE = 0x0e , llvm::wasm::WASM_OPCODE_RETURN = 0x0f ,
  llvm::wasm::WASM_OPCODE_DROP = 0x1a , llvm::wasm::WASM_OPCODE_MISC_PREFIX = 0xfc , llvm::wasm::WASM_OPCODE_MEMORY_INIT = 0x08 , llvm::wasm::WASM_OPCODE_MEMORY_FILL = 0x0b ,
  llvm::wasm::WASM_OPCODE_DATA_DROP = 0x09 , llvm::wasm::WASM_OPCODE_ATOMICS_PREFIX = 0xfe , llvm::wasm::WASM_OPCODE_ATOMIC_NOTIFY = 0x00 , llvm::wasm::WASM_OPCODE_I32_ATOMIC_WAIT = 0x01 ,
  llvm::wasm::WASM_OPCODE_I32_ATOMIC_STORE = 0x17 , llvm::wasm::WASM_OPCODE_I32_RMW_CMPXCHG = 0x48
}
 
enum  : unsigned { llvm::wasm::WASM_LIMITS_FLAG_NONE = 0x0 , llvm::wasm::WASM_LIMITS_FLAG_HAS_MAX = 0x1 , llvm::wasm::WASM_LIMITS_FLAG_IS_SHARED = 0x2 , llvm::wasm::WASM_LIMITS_FLAG_IS_64 = 0x4 }
 
enum  : unsigned { llvm::wasm::WASM_DATA_SEGMENT_IS_PASSIVE = 0x01 , llvm::wasm::WASM_DATA_SEGMENT_HAS_MEMINDEX = 0x02 }
 
enum  : unsigned { llvm::wasm::WASM_ELEM_SEGMENT_IS_PASSIVE = 0x01 , llvm::wasm::WASM_ELEM_SEGMENT_IS_DECLARATIVE = 0x02 , llvm::wasm::WASM_ELEM_SEGMENT_HAS_TABLE_NUMBER = 0x02 , llvm::wasm::WASM_ELEM_SEGMENT_HAS_INIT_EXPRS = 0x04 }
 
enum  : uint8_t { llvm::wasm::WASM_FEATURE_PREFIX_USED = '+' , llvm::wasm::WASM_FEATURE_PREFIX_REQUIRED = '=' , llvm::wasm::WASM_FEATURE_PREFIX_DISALLOWED = '-' }
 
enum  : unsigned {
  llvm::wasm::WASM_NAMES_MODULE = 0 , llvm::wasm::WASM_NAMES_FUNCTION = 1 , llvm::wasm::WASM_NAMES_LOCAL = 2 , llvm::wasm::WASM_NAMES_GLOBAL = 7 ,
  llvm::wasm::WASM_NAMES_DATA_SEGMENT = 9
}
 
enum  : unsigned { llvm::wasm::WASM_SEGMENT_INFO = 0x5 , llvm::wasm::WASM_INIT_FUNCS = 0x6 , llvm::wasm::WASM_COMDAT_INFO = 0x7 , llvm::wasm::WASM_SYMBOL_TABLE = 0x8 }
 
enum  : unsigned { llvm::wasm::WASM_DYLINK_MEM_INFO = 0x1 , llvm::wasm::WASM_DYLINK_NEEDED = 0x2 , llvm::wasm::WASM_DYLINK_EXPORT_INFO = 0x3 , llvm::wasm::WASM_DYLINK_IMPORT_INFO = 0x4 }
 
enum  : unsigned { llvm::wasm::WASM_COMDAT_DATA = 0x0 , llvm::wasm::WASM_COMDAT_FUNCTION = 0x1 , llvm::wasm::WASM_COMDAT_SECTION = 0x5 }
 
enum  llvm::wasm::WasmSymbolType : unsigned {
  llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION = 0x0 , llvm::wasm::WASM_SYMBOL_TYPE_DATA = 0x1 , llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL = 0x2 , llvm::wasm::WASM_SYMBOL_TYPE_SECTION = 0x3 ,
  llvm::wasm::WASM_SYMBOL_TYPE_TAG = 0x4 , llvm::wasm::WASM_SYMBOL_TYPE_TABLE = 0x5
}
 
enum  llvm::wasm::WasmSegmentFlag : unsigned { llvm::wasm::WASM_SEG_FLAG_STRINGS = 0x1 , llvm::wasm::WASM_SEG_FLAG_TLS = 0x2 , llvm::wasm::WASM_SEG_FLAG_RETAIN = 0x4 }
 
enum  llvm::wasm::WasmTagAttribute : uint8_t { llvm::wasm::WASM_TAG_ATTRIBUTE_EXCEPTION = 0x0 }
 
enum  : unsigned
 
enum class  llvm::wasm::ValType {
  llvm::wasm::I32 = WASM_TYPE_I32 , llvm::wasm::I64 = WASM_TYPE_I64 , llvm::wasm::F32 = WASM_TYPE_F32 , llvm::wasm::F64 = WASM_TYPE_F64 ,
  llvm::wasm::V128 = WASM_TYPE_V128 , llvm::wasm::FUNCREF = WASM_TYPE_FUNCREF , llvm::wasm::EXTERNREF = WASM_TYPE_EXTERNREF , llvm::wasm::EXNREF = WASM_TYPE_EXNREF ,
  llvm::wasm::OTHERREF = 0xff
}
 
enum class  llvm::wasm::NameType { llvm::wasm::FUNCTION , llvm::wasm::GLOBAL , llvm::wasm::DATA_SEGMENT }
 

Functions

bool llvm::wasm::operator== (const WasmSignature &LHS, const WasmSignature &RHS)
 
bool llvm::wasm::operator!= (const WasmSignature &LHS, const WasmSignature &RHS)
 
bool llvm::wasm::operator== (const WasmGlobalType &LHS, const WasmGlobalType &RHS)
 
bool llvm::wasm::operator!= (const WasmGlobalType &LHS, const WasmGlobalType &RHS)
 
bool llvm::wasm::operator== (const WasmLimits &LHS, const WasmLimits &RHS)
 
bool llvm::wasm::operator== (const WasmTableType &LHS, const WasmTableType &RHS)
 
llvm::StringRef llvm::wasm::toString (WasmSymbolType type)
 
llvm::StringRef llvm::wasm::relocTypetoString (uint32_t type)
 
llvm::StringRef llvm::wasm::sectionTypeToString (uint32_t type)
 
bool llvm::wasm::relocTypeHasAddend (uint32_t type)
 

Variables

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

Macro Definition Documentation

◆ WASM_RELOC

#define WASM_RELOC (   name,
  value 
)    name = value,

Definition at line 243 of file Wasm.h.