aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Option/ArgList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Option/ArgList.cpp')
-rw-r--r--lib/Option/ArgList.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp
index 39b22d7..15f7e8b 100644
--- a/lib/Option/ArgList.cpp
+++ b/lib/Option/ArgList.cpp
@@ -206,6 +206,13 @@ bool ArgList::hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default) const {
return Default;
}
+bool ArgList::hasFlag(OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg,
+ bool Default) const {
+ if (Arg *A = getLastArg(Pos, PosAlias, Neg))
+ return A->getOption().matches(Pos) || A->getOption().matches(PosAlias);
+ return Default;
+}
+
StringRef ArgList::getLastArgValue(OptSpecifier Id,
StringRef Default) const {
if (Arg *A = getLastArg(Id))
@@ -226,6 +233,14 @@ void ArgList::AddLastArg(ArgStringList &Output, OptSpecifier Id) const {
}
}
+void ArgList::AddLastArg(ArgStringList &Output, OptSpecifier Id0,
+ OptSpecifier Id1) const {
+ if (Arg *A = getLastArg(Id0, Id1)) {
+ A->claim();
+ A->render(*this, Output);
+ }
+}
+
void ArgList::AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
OptSpecifier Id1, OptSpecifier Id2) const {
for (arg_iterator it = filtered_begin(Id0, Id1, Id2),