aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-24 17:31:30 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-24 17:31:30 +0000
commitfe2e04a979205c1f395b699a24d74adb82bb4833 (patch)
tree18db858fe61553a73ebe3da3b2dcb4489835b3e9 /lib/Driver/ArgList.cpp
parente65a3c8f181adc42786e0a409cd1e827f4ab37ff (diff)
Driver: ArgList::getLastArg was in fact returning the first matching arg.
- <rdar://problem/6715818> clang doesn't honor gcc semantic that last -O optimization option wins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 7653daf7ee..d74e3bd59d 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -34,9 +34,7 @@ void ArgList::append(Arg *A) {
Arg *ArgList::getLastArg(options::ID Id, bool Claim) const {
// FIXME: Make search efficient?
-
- // FIXME: This needs to not require loading of the option.
- for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
+ for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it) {
if ((*it)->getOption().matches(Id)) {
if (Claim) (*it)->claim();
return *it;