diff options
author | Alon Zakai <azakai@google.com> | 2023-01-13 10:06:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 18:06:56 +0000 |
commit | 26d3eaada5e8f386b4cfff64461792824c9ff596 (patch) | |
tree | 8971ac7c81d11dfa52e6b0a3b58a2b86a5d2cd4b /src | |
parent | 589b3fde7511d53f2be251b5d741e422cde39ec6 (diff) | |
download | binaryen-26d3eaada5e8f386b4cfff64461792824c9ff596.tar.gz binaryen-26d3eaada5e8f386b4cfff64461792824c9ff596.tar.bz2 binaryen-26d3eaada5e8f386b4cfff64461792824c9ff596.zip |
Move closed world flag to tool options (#5428)
This allows tools like wasm-reduce to be told to operate in closed-world mode. That
lets them validate in the more strict way of that mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/optimization-options.h | 12 | ||||
-rw-r--r-- | src/tools/tool-options.h | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/tools/optimization-options.h b/src/tools/optimization-options.h index eaa90f55f..698d3305e 100644 --- a/src/tools/optimization-options.h +++ b/src/tools/optimization-options.h @@ -270,18 +270,6 @@ struct OptimizationOptions : public ToolOptions { OptimizationOptionsCategory, Options::Arguments::Zero, [this](Options*, const std::string&) { passOptions.fastMath = true; }) - .add( - "--closed-world", - "-cw", - "Assume code outside of the module does not inspect or interact with " - "GC and function references, even if they are passed out. The outside " - "may hold on to them and pass them back in, but not inspect their " - "contents or call them.", - OptimizationOptionsCategory, - Options::Arguments::Zero, - [this](Options*, const std::string&) { - passOptions.closedWorld = true; - }) .add("--zero-filled-memory", "-uim", "Assume that an imported memory will be zero-initialized", diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 0522b5538..02b825079 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -156,7 +156,19 @@ struct ToolOptions : public Options { Options::Arguments::Zero, [](Options* o, const std::string& argument) { setTypeSystem(TypeSystem::Isorecursive); - }); + }) + .add( + "--closed-world", + "-cw", + "Assume code outside of the module does not inspect or interact with " + "GC and function references, even if they are passed out. The outside " + "may hold on to them and pass them back in, but not inspect their " + "contents or call them.", + ToolOptionsCategory, + Options::Arguments::Zero, + [this](Options*, const std::string&) { + passOptions.closedWorld = true; + }); } ToolOptions& addFeature(FeatureSet::Feature feature, |