summaryrefslogtreecommitdiff
path: root/src/generate-names.cc
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-02-28 17:08:32 -0800
committerGitHub <noreply@github.com>2020-02-28 17:08:32 -0800
commit2d5bdb4a3a1bf8541dda300ffc2d35ffd9d4f84b (patch)
tree37ae07bfac508745bb6d020df8860029300448bc /src/generate-names.cc
parent02aa62e015e3eff5a50bad5d94d9a7d98f4e9d89 (diff)
downloadwabt-2d5bdb4a3a1bf8541dda300ffc2d35ffd9d4f84b.tar.gz
wabt-2d5bdb4a3a1bf8541dda300ffc2d35ffd9d4f84b.tar.bz2
wabt-2d5bdb4a3a1bf8541dda300ffc2d35ffd9d4f84b.zip
Add TypeEntry, base class for type section entries (#1349)
The type section currently only has one form: functions. With the GC proposal, at least two more forms are added: struct and array. To facilitate this: * Rename FuncTypeModuleField -> TypeModuleField * Rename Module::func_types -> Module::types * Rename func_type_bindings -> type_bindings * TypeEntry is added as a base class of FuncType * TypeModuleField stores a unique_ptr to a TypeEntry
Diffstat (limited to 'src/generate-names.cc')
-rw-r--r--src/generate-names.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/generate-names.cc b/src/generate-names.cc
index e615d471..03758e94 100644
--- a/src/generate-names.cc
+++ b/src/generate-names.cc
@@ -86,7 +86,7 @@ class NameGenerator : public ExprVisitor::DelegateNop {
Result VisitFunc(Index func_index, Func* func);
Result VisitGlobal(Index global_index, Global* global);
- Result VisitFuncType(Index func_type_index, FuncType* func_type);
+ Result VisitType(Index func_type_index, TypeEntry* type);
Result VisitTable(Index table_index, Table* table);
Result VisitMemory(Index memory_index, Memory* memory);
Result VisitEvent(Index event_index, Event* event);
@@ -241,10 +241,9 @@ Result NameGenerator::VisitGlobal(Index global_index, Global* global) {
return Result::Ok;
}
-Result NameGenerator::VisitFuncType(Index func_type_index,
- FuncType* func_type) {
- MaybeGenerateAndBindName(&module_->func_type_bindings, "t", func_type_index,
- &func_type->name);
+Result NameGenerator::VisitType(Index type_index, TypeEntry* type) {
+ MaybeGenerateAndBindName(&module_->type_bindings, "t", type_index,
+ &type->name);
return Result::Ok;
}
@@ -411,7 +410,7 @@ Result NameGenerator::VisitModule(Module* module) {
}
VisitAll(module->globals, &NameGenerator::VisitGlobal);
- VisitAll(module->func_types, &NameGenerator::VisitFuncType);
+ VisitAll(module->types, &NameGenerator::VisitType);
VisitAll(module->funcs, &NameGenerator::VisitFunc);
VisitAll(module->tables, &NameGenerator::VisitTable);
VisitAll(module->memories, &NameGenerator::VisitMemory);