Driver: Add ArgList::getLastArg.
llvm-svn: 66794
diff --git a/clang/lib/Driver/ArgList.cpp b/clang/lib/Driver/ArgList.cpp
index aaba406..e29977f 100644
--- a/clang/lib/Driver/ArgList.cpp
+++ b/clang/lib/Driver/ArgList.cpp
@@ -30,13 +30,13 @@
Args.push_back(A);
}
-bool ArgList::hasArg(options::ID Id) const {
+Arg *ArgList::getLastArg(options::ID Id) 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)
if ((*it)->getOption().matches(Id))
- return true;
+ return *it;
- return false;
+ return 0;
}