diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-10-15 17:37:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-16 00:37:23 +0000 |
commit | 0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2 (patch) | |
tree | ce9ad99518d896956260e7f27a56eba0b8a5f7fd /src | |
parent | 980bb397fa713385d7e0a7f1ddc0318a3da7234c (diff) | |
download | binaryen-0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2.tar.gz binaryen-0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2.tar.bz2 binaryen-0bec0a4bbaf4859bb4c7a2f1c4ecda60ccab72f2.zip |
Add a --structural flag (#4252)
Just as the --nominal flag forces all types to be parsed as nominal, the
--structural flag forces all types to be parsed as equirecursive. This is the
current default behavior, but a future PR will change the default to parse types
as either structural or nominal according to their syntax or encoding. This new
flag will then be necessary to get the current behavior.
Also take this opportunity to deduplicate more flags in the help tests.
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/tool-options.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 4b589b5b2..a73d72d09 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -112,11 +112,18 @@ struct ToolOptions : public Options { }) .add("--nominal", "", - "Use the prototype nominal type system instead of the normal " - "equirecursive type system.", + "Force all GC type definitions to be parsed as nominal.", Options::Arguments::Zero, [](Options* o, const std::string& argument) { setTypeSystem(TypeSystem::Nominal); + }) + .add("--structural", + "", + "Force all GC type definitions to be parsed as structural " + "(i.e. equirecursive). This is the default.", + Options::Arguments::Zero, + [](Options* o, const std::string& argument) { + setTypeSystem(TypeSystem::Equirecursive); }); } |