aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 69cb85b7fc..7823673024 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -50,12 +50,8 @@ Arg *ArgList::getLastArg(options::ID Id0, options::ID Id1, bool Claim) const {
}
bool ArgList::hasFlag(options::ID Pos, options::ID Neg, bool Default) const {
- Arg *PosA = getLastArg(Pos);
- Arg *NegA = getLastArg(Neg);
- if (PosA && NegA)
- return NegA->getIndex() < PosA->getIndex();
- if (PosA) return true;
- if (NegA) return false;
+ if (Arg *A = getLastArg(Pos, Neg))
+ return A->getOption().matches(Pos);
return Default;
}