MCPcopy Create free account
hub / github.com/WebAssembly/wabt / GetDeclarationType

Method GetDeclarationType

src/validator.cc:298–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298Type Validator::GetDeclarationType(const FuncDeclaration& decl) {
299 if (decl.has_func_type) {
300 return Type(decl.type_var.index());
301 }
302 if (decl.sig.param_types.empty()) {
303 if (decl.sig.result_types.empty()) {
304 return Type::Void;
305 }
306 if (decl.sig.result_types.size() == 1) {
307 return decl.sig.result_types[0];
308 }
309 }
310 return Type(current_module_->GetFuncTypeIndex(decl));
311}
312
313Var Validator::GetFuncTypeIndex(const Location& default_loc,
314 const FuncDeclaration& decl) {

Callers

nothing calls this directly

Calls 5

indexMethod · 0.80
TypeClass · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
GetFuncTypeIndexMethod · 0.45

Tested by

no test coverage detected