diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-02-18 21:48:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 21:48:19 -0800 |
commit | b6c094c8760b3c3e7ffbc54c46c6329b22d88cfe (patch) | |
tree | 7174a70f0a73974b3b472eb0a18d175abf7e9b5f /test/passes/dwarf_with_exceptions.cpp | |
parent | 22fc60d86538a6111f7b953fd70362ee73dce7d8 (diff) | |
download | binaryen-b6c094c8760b3c3e7ffbc54c46c6329b22d88cfe.tar.gz binaryen-b6c094c8760b3c3e7ffbc54c46c6329b22d88cfe.tar.bz2 binaryen-b6c094c8760b3c3e7ffbc54c46c6329b22d88cfe.zip |
Support type uses before definitions in text parser (#3584)
Traverses the module to find type definitions and uses a TypeBuilder to
construct the corresponding HeapTypes rather than constructing them directly.
This allows types to be used in the definitions of other types before they
themselves are defined, which is an important step toward supporting recursive
types. After this PR, no further text parsing changes will be necessary to
support recursive types.
Beyond allowing types to be used before their definitions, this PR also makes a
couple incidental changes to the parser's behavior. First, compound heaptypes
can now only be declared in `(type ...)` elements and cannot be declared inline
at their site of use. This reduces the flexibility of the parser, but is in line
with what the text format spec will probably look like eventually (see
https://github.com/WebAssembly/function-references/issues/42).
The second change is that `(type ...)` elements are now all parsed before `(func
...)` elements rather than in text order with them, so the type indices will be
different and wasts using numeric type indices will be broken. Note however,
that we were already not completely spec compliant in this regard because we
parsed types defined by `(type...)` and `(func...)` elements before types
defined by the type uses of `call_indirect` instructions.
Diffstat (limited to 'test/passes/dwarf_with_exceptions.cpp')
0 files changed, 0 insertions, 0 deletions