summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pass.h b/src/pass.h
index 99b3fb4e2..120ed2629 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -188,7 +188,7 @@ struct PassOptions {
bool debugInfo = false;
// Arbitrary string arguments from the commandline, which we forward to
// passes.
- std::map<std::string, std::string> arguments;
+ std::unordered_map<std::string, std::string> arguments;
// Effect info computed for functions. One pass can generate this and then
// other passes later can benefit from it. It is up to the sequence of passes
@@ -217,15 +217,17 @@ struct PassOptions {
return PassOptions(); // defaults are to not optimize
}
+ bool hasArgument(std::string key) { return arguments.count(key) > 0; }
+
std::string getArgument(std::string key, std::string errorTextIfMissing) {
- if (arguments.count(key) == 0) {
+ if (!hasArgument(key)) {
Fatal() << errorTextIfMissing;
}
return arguments[key];
}
std::string getArgumentOrDefault(std::string key, std::string default_) {
- if (arguments.count(key) == 0) {
+ if (!hasArgument(key)) {
return default_;
}
return arguments[key];