MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadSortIndex

Method loadSortIndex

lib/loader/ast/component/component_sort.cpp:9–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace Loader {
8
9Expect<void> Loader::loadSortIndex(AST::Component::SortIndex &SortIdx,
10 const bool IsCore) {
11 // sortidx ::= sort:<sort> idx:<u32> => (sort idx)
12 // core:sortidx ::= sort:<core:sort> idx:<u32> => (sort idx)
13 if (IsCore) {
14 EXPECTED_TRY(loadCoreSort(SortIdx.getSort()));
15 } else {
16 EXPECTED_TRY(loadSort(SortIdx.getSort()));
17 }
18 EXPECTED_TRY(uint32_t Idx, FMgr.readU32().map_error([this](auto E) {
19 return logLoadError(E, FMgr.getLastOffset(), ASTNodeAttr::Comp_Sort);
20 }));
21 SortIdx.setIdx(Idx);
22 return {};
23}
24
25Expect<void> Loader::loadSort(AST::Component::Sort &Sort) {
26 // sort ::= 0x00 cs:<core:sort> => core cs

Callers

nothing calls this directly

Calls 2

EXPECTED_TRYFunction · 0.70
setIdxMethod · 0.45

Tested by

no test coverage detected