First = Func,
Last = Catch,
};
constexpr int kLabelTypeCount = WABT_ENUM_COUNT(LabelType);
struct Location { enumclass Type {
Text,
Binary,
};
Location() : line(0), first_column(0), last_column(0) {}
Location(std::string_view filename, int line, int first_column, int last_column)
: filename(filename),
line(line),
first_column(first_column),
last_column(last_column) {} explicit Location(size_t offset) : offset(offset) {}
std::string_view filename; union { // For text files. struct { int line; int first_column; int last_column;
}; // For binary files. struct {
size_t offset;
};
};
};
// Used in test asserts for special expected values "nan:canonical" and // "nan:arithmetic" enumclass ExpectedNan {
None,
Canonical,
Arithmetic,
};
// Matches binary format, do not change. enum SegmentFlags : uint8_t {
SegFlagsNone = 0,
SegPassive = 1, // bit 0: Is passive
SegExplicitIndex = 2, // bit 1: Has explict index (Implies table 0 if absent)
SegDeclared = 3, // Only used for declared segments
SegUseElemExprs = 4, // bit 2: Is elemexpr (Or else index sequence)
enumclass RelocType {
FuncIndexLEB = 0, // e.g. Immediate of call instruction
TableIndexSLEB = 1, // e.g. Loading address of function
TableIndexI32 = 2, // e.g. Function address in DATA
MemoryAddressLEB = 3, // e.g. Memory address in load/store offset immediate
MemoryAddressSLEB = 4, // e.g. Memory address in i32.const
MemoryAddressI32 = 5, // e.g. Memory address in DATA
TypeIndexLEB = 6, // e.g. Immediate type in call_indirect
GlobalIndexLEB = 7, // e.g. Immediate of global.get inst
FunctionOffsetI32 = 8, // e.g. Code offset in DWARF metadata
SectionOffsetI32 = 9, // e.g. Section offset in DWARF metadata
TagIndexLEB = 10, // Used in throw instructions
MemoryAddressRelSLEB = 11, // In PIC code, addr relative to __memory_base
TableIndexRelSLEB = 12, // In PIC code, table index relative to __table_base
GlobalIndexI32 = 13, // e.g. Global index in data (e.g. DWARF)
MemoryAddressLEB64 = 14, // Memory64: Like MemoryAddressLEB
MemoryAddressSLEB64 = 15, // Memory64: Like MemoryAddressSLEB
MemoryAddressI64 = 16, // Memory64: Like MemoryAddressI32
MemoryAddressRelSLEB64 = 17, // Memory64: Like MemoryAddressRelSLEB
TableIndexSLEB64 = 18, // Memory64: Like TableIndexSLEB
TableIndexI64 = 19, // Memory64: Like TableIndexI32
TableNumberLEB = 20, // e.g. Immediate of table.get
MemoryAddressTLSSLEB = 21, // Address relative to __tls_base
FunctionOffsetI64 = 22, // Memory64: Like FunctionOffsetI32
MemoryAddressLocRelI32 = 23, // Address relative to the relocation's location
TableIndexRelSLEB64 = 24, // Memory64: TableIndexRelSLEB
MemoryAddressTLSSLEB64 = 25, // Memory64: MemoryAddressTLSSLEB
FuncIndexI32 = 26, // Function index as an I32
First = FuncIndexLEB,
Last = FuncIndexI32,
};
constexpr int kRelocTypeCount = WABT_ENUM_COUNT(RelocType);
staticinlineconstchar* GetSymbolTypeName(SymbolType type) { switch (type) { case SymbolType::Function: return"func"; case SymbolType::Global: return"global"; case SymbolType::Data: return"data"; case SymbolType::Section: return"section"; case SymbolType::Tag: return"tag"; case SymbolType::Table: return"table"; default: return"<error_symbol_type>";
}
}
inlinevoid SwapBytesSized(void* addr, size_t size) { auto bytes = static_cast<uint8_t*>(addr); for (size_t i = 0; i < size / 2; i++) {
std::swap(bytes[i], bytes[size - 1 - i]);
}
}
} // namespace wabt
#endif// WABT_COMMON_H_
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.