From e0a8f40f65b178556f6fcbed778923a36dca64e3 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 15 Jun 2021 00:07:55 -0400 Subject: Parsing and emitting nominal types (#3933) Adds a `--nominal` option to switch the type machinery from equirecursive to nominal. Implements binary and text parsing and emitting of nominal types using new type constructor opcodes and an `(extends $super)` text syntax extension. When not in nominal mode, these extensions will still be parsed but will not have any effect and will not be used when emitting. --- src/ir/module-utils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ir/module-utils.h') diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index 486838aea..aaf484036 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -566,6 +566,13 @@ inline void collectHeapTypes(Module& wasm, counts.note(child); } } + HeapType super; + if (ht.getSuperType(super)) { + if (!counts.count(super)) { + newTypes.insert(super); + } + counts.note(super); + } } // Sort by frequency and then original insertion order. -- cgit v1.2.3