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

Method addTypeImpl

include/validator/component_context.h:371–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369
370private:
371 uint32_t addTypeImpl(const AST::Component::DefType *DT,
372 bool IsLocal) noexcept {
373 auto &Ctx = getCurrentContext();
374 uint32_t Idx = static_cast<uint32_t>(Ctx.Types.size());
375 Ctx.Types.push_back(DT);
376 if (DT != nullptr) {
377 if (DT->isInstanceType()) {
378 Ctx.InstanceTypes[Idx] = &DT->getInstanceType();
379 } else if (DT->isResourceType()) {
380 Ctx.ResourceTypes[Idx] = &DT->getResourceType();
381 if (IsLocal) {
382 Ctx.DefinedResources.insert(Idx);
383 }
384 }
385 }
386 return Idx;
387 }
388
389 std::deque<Context> CompCtxs;
390};

Callers

nothing calls this directly

Calls 6

isInstanceTypeMethod · 0.80
getInstanceTypeMethod · 0.80
getResourceTypeMethod · 0.80
insertMethod · 0.80
sizeMethod · 0.45
isResourceTypeMethod · 0.45

Tested by

no test coverage detected