summaryrefslogtreecommitdiff
path: root/src/tools/tool-options.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tool-options.h')
-rw-r--r--src/tools/tool-options.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h
index f900d76ba..c7acf1d46 100644
--- a/src/tools/tool-options.h
+++ b/src/tools/tool-options.h
@@ -82,7 +82,16 @@ struct ToolOptions : public Options {
.addFeature(FeatureSet::MutableGlobals, "mutable globals")
.addFeature(FeatureSet::TruncSat, "nontrapping float-to-int operations")
.addFeature(FeatureSet::SIMD, "SIMD operations and types")
- .addFeature(FeatureSet::BulkMemory, "bulk memory operations")
+ .addFeature(FeatureSet::BulkMemory,
+ "bulk memory operations",
+ FeatureSet(FeatureSet::BulkMemoryOpt))
+ .addFeature(FeatureSet::BulkMemoryOpt,
+ "memory.copy and memory.fill",
+ FeatureSet::None,
+ FeatureSet(FeatureSet::BulkMemory))
+ .addFeature(FeatureSet::CallIndirectOverlong,
+ "LEB encoding of call-indirect (Ignored for compatibility as "
+ "it has no effect on Binaryen)")
.addFeature(FeatureSet::ExceptionHandling,
"exception handling operations")
.addFeature(FeatureSet::TailCall, "tail call operations")
@@ -200,16 +209,18 @@ struct ToolOptions : public Options {
}
ToolOptions& addFeature(FeatureSet::Feature feature,
- const std::string& description) {
+ const std::string& description,
+ FeatureSet impliedEnable = FeatureSet::None,
+ FeatureSet impliedDisable = FeatureSet::None) {
(*this)
.add(std::string("--enable-") + FeatureSet::toString(feature),
"",
std::string("Enable ") + description,
ToolOptionsCategory,
Arguments::Zero,
- [this, feature](Options*, const std::string&) {
- enabledFeatures.set(feature, true);
- disabledFeatures.set(feature, false);
+ [this, feature, impliedEnable](Options*, const std::string&) {
+ enabledFeatures.set(feature | impliedEnable, true);
+ disabledFeatures.set(feature | impliedEnable, false);
})
.add(std::string("--disable-") + FeatureSet::toString(feature),
@@ -217,9 +228,9 @@ struct ToolOptions : public Options {
std::string("Disable ") + description,
ToolOptionsCategory,
Arguments::Zero,
- [this, feature](Options*, const std::string&) {
- enabledFeatures.set(feature, false);
- disabledFeatures.set(feature, true);
+ [this, feature, impliedDisable](Options*, const std::string&) {
+ enabledFeatures.set(feature | impliedDisable, false);
+ disabledFeatures.set(feature | impliedDisable, true);
});
return *this;
}