aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-12 01:36:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-12 01:36:44 +0000
commitd8cadd4f250d1b69373fc80477f67375d2c54820 (patch)
treea7d8879b3b8368e46f9c2276f092c4a2ac31fb1e /lib/Driver/ArgList.cpp
parentcf0dd156e7b9d6a70b7290f5af9646859631bd9a (diff)
Driver: Add ArgList::hasArg, for testing for the presence of an
argument matching some Option::ID. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index a45e9d67b2..6a056074b7 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -29,3 +29,14 @@ void ArgList::append(Arg *A) {
Args.push_back(A);
}
+
+bool ArgList::hasArg(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; ++ie)
+ if ((*it)->getOption().matches(Id))
+ return true;
+
+ return false;
+}