diff options
Diffstat (limited to 'src/tools/optimization-options.h')
-rw-r--r-- | src/tools/optimization-options.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/optimization-options.h b/src/tools/optimization-options.h index 4b8bfc139..dfc61b0e3 100644 --- a/src/tools/optimization-options.h +++ b/src/tools/optimization-options.h @@ -101,6 +101,17 @@ struct OptimizationOptions : public ToolOptions { Options::Arguments::Zero, [this](Options*, const std::string&) { passOptions.lowMemoryUnused = true; + }) + .add("--pass-arg", "-pa", "An argument passed along to optimization passes being run. Must be in the form KEY:VALUE", + Options::Arguments::N, + [this](Options*, const std::string& argument) { + auto colon = argument.find(':'); + if (colon == std::string::npos) { + Fatal() << "--pass-arg value must be in the form of KEY:VALUE"; + } + auto key = argument.substr(0, colon); + auto value = argument.substr(colon + 1); + passOptions.arguments[key] = value; }); // add passes in registry for (const auto& p : PassRegistry::get()->getRegisteredNames()) { |