From 26d3eaada5e8f386b4cfff64461792824c9ff596 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 13 Jan 2023 10:06:56 -0800 Subject: 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. --- src/tools/optimization-options.h | 12 ------------ src/tools/tool-options.h | 14 +++++++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') 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, -- cgit v1.2.3