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

Method ResolveLocalVar

src/resolve-names.cc:230–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void NameResolver::ResolveLocalVar(Var* var) {
231 if (var->is_name()) {
232 if (!current_func_) {
233 return;
234 }
235
236 Index index = current_func_->GetLocalIndex(*var);
237 if (index == kInvalidIndex) {
238 PrintError(&var->loc, "undefined local variable \"%s\"",
239 var->name().c_str());
240 return;
241 }
242
243 var->set_index(index);
244 }
245}
246
247void NameResolver::ResolveBlockDeclarationVar(BlockDeclaration* decl) {
248 if (decl->has_func_type) {

Callers

nothing calls this directly

Calls 4

is_nameMethod · 0.80
set_indexMethod · 0.80
GetLocalIndexMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected