summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pass.h b/src/pass.h
index 9ef159d7d..6116a9cca 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -76,6 +76,8 @@ struct PassOptions {
bool debugInfo = false;
// Which wasm features to accept, and be allowed to use.
FeatureSet features = FeatureSet::All;
+ // Arbitrary string arguments from the commandline, which we forward to passes.
+ std::map<std::string, std::string> arguments;
void setDefaultOptimizationOptions() {
// -Os is our default
@@ -92,6 +94,13 @@ struct PassOptions {
static PassOptions getWithoutOptimization() {
return PassOptions(); // defaults are to not optimize
}
+
+ std::string getArgument(std::string key, std::string errorTextIfMissing) {
+ if (arguments.count(key) == 0) {
+ Fatal() << errorTextIfMissing;
+ }
+ return arguments[key];
+ }
};
//