summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-01-19 10:14:45 -0800
committerGitHub <noreply@github.com>2022-01-19 10:14:45 -0800
commitb9fdc3b1155c48749f48f5b530d8ab295ea3185b (patch)
treee3b2dbdcb346e83cdccdfe99b3e77557ad3585eb /src
parent59494a57abf7873e09fd4fba8e0413f649b64525 (diff)
downloadbinaryen-b9fdc3b1155c48749f48f5b530d8ab295ea3185b.tar.gz
binaryen-b9fdc3b1155c48749f48f5b530d8ab295ea3185b.tar.bz2
binaryen-b9fdc3b1155c48749f48f5b530d8ab295ea3185b.zip
Add a `--hybrid` type system option (#4460)
Eventually this will enable the isorecursive hybrid type system described in https://github.com/WebAssembly/gc/pull/243, but for now it just throws a fatal error if used.
Diffstat (limited to 'src')
-rw-r--r--src/tools/tool-options.h9
-rw-r--r--src/wasm-type.h1
-rw-r--r--src/wasm/wasm-type.cpp3
3 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h
index f45569648..0ed0f27fb 100644
--- a/src/tools/tool-options.h
+++ b/src/tools/tool-options.h
@@ -135,6 +135,15 @@ struct ToolOptions : public Options {
Options::Arguments::Zero,
[](Options* o, const std::string& argument) {
setTypeSystem(TypeSystem::Equirecursive);
+ })
+ .add("--hybrid",
+ "",
+ "Force all GC type definitions to be parsed using the isorecursive "
+ "hybrid type system.",
+ ToolOptionsCategory,
+ Options::Arguments::Zero,
+ [](Options* o, const std::string& argument) {
+ setTypeSystem(TypeSystem::Isorecursive);
});
}
diff --git a/src/wasm-type.h b/src/wasm-type.h
index a54104cc0..c80e7cd0b 100644
--- a/src/wasm-type.h
+++ b/src/wasm-type.h
@@ -36,6 +36,7 @@ namespace wasm {
enum class TypeSystem {
Equirecursive,
Nominal,
+ Isorecursive,
};
// This should only ever be called before any Types or HeapTypes have been
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index a63c66770..738cd6e29 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -3197,6 +3197,9 @@ std::vector<HeapType> TypeBuilder::build() {
case TypeSystem::Nominal:
canonicalizeNominal(state);
break;
+ case TypeSystem::Isorecursive:
+ Fatal() << "Isorecursive types not yet implemented";
+ break;
}
#if TIME_CANONICALIZATION