summaryrefslogtreecommitdiff
path: root/scripts/gen-s-parser.py
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-12-10 16:42:21 -0800
committerGitHub <noreply@github.com>2020-12-10 16:42:21 -0800
commite1978e0274de74aa9ce5c6bcfa71e03ddadeb685 (patch)
treef40cee27f675a83a681f7ba8086dc3e2ed0a833a /scripts/gen-s-parser.py
parentc93da3de39a4592abc6cddbed30b5c7074069a24 (diff)
downloadbinaryen-e1978e0274de74aa9ce5c6bcfa71e03ddadeb685.tar.gz
binaryen-e1978e0274de74aa9ce5c6bcfa71e03ddadeb685.tar.bz2
binaryen-e1978e0274de74aa9ce5c6bcfa71e03ddadeb685.zip
TypeBuilder (#3418)
Introduce TypeBuilder, a utility for constructing heap types in terms of other heap types that may have not yet been defined. Internally, it works by creating HeapTypes backed by mutable HeapTypeInfos owned by the TypeBuilder. That lets the TypeBuilder create temporary Types that can refer to the TypeBuilder-managed HeapTypes. Those temporary Types can in turn be used to initialize the very HeapTypes they refer to. Since the TypeBuilder-managed HeapTypes are only valid for the lifetime of their TypeBuilder, there is a canonicalization step that converts them into globally interned canonical HeapTypes. This PR allows HeapTypes to be built in terms of as of yet undefined HeapTypes, but it currently errors out in the presence of recursive types. Supporting recursive types will require further work to canonicalize them into finite, acyclic representations. Currently any attempt to compare, print, or otherwise manipulate recursive types would infinitely recurse.
Diffstat (limited to 'scripts/gen-s-parser.py')
0 files changed, 0 insertions, 0 deletions