summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pass.h b/src/pass.h
index cc8261731..59f0d3dcb 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -63,6 +63,18 @@ struct PassOptions {
bool ignoreImplicitTraps = false; // optimize assuming things like div by 0, bad load/store, will not trap
bool debugInfo = false; // whether to try to preserve debug info through, which are special calls
FeatureSet features = Feature::MVP; // Which wasm features to accept, and be allowed to use
+
+ void setDefaultOptimizationOptions() {
+ // -Os is our default
+ optimizeLevel = 2;
+ shrinkLevel = 1;
+ }
+
+ static PassOptions getWithDefaultOptimizationOptions() {
+ PassOptions ret;
+ ret.setDefaultOptimizationOptions();
+ return ret;
+ }
};
//