diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-12 01:36:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-12 01:36:44 +0000 |
commit | 2c3939cb5d656d01d0b5986154bb977a71876ac7 (patch) | |
tree | 04bec8dbaab24f53702fcda7f89b794f07e8a119 /clang/lib/Driver/ArgList.cpp | |
parent | 8fa943436bbb45a56ac2d1d7cdd7c323d07f72fe (diff) | |
download | bcm5719-llvm-2c3939cb5d656d01d0b5986154bb977a71876ac7.tar.gz bcm5719-llvm-2c3939cb5d656d01d0b5986154bb977a71876ac7.zip |
Driver: Add ArgList::hasArg, for testing for the presence of an
argument matching some Option::ID.
llvm-svn: 66758
Diffstat (limited to 'clang/lib/Driver/ArgList.cpp')
-rw-r--r-- | clang/lib/Driver/ArgList.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Driver/ArgList.cpp b/clang/lib/Driver/ArgList.cpp index a45e9d67b21..6a056074b7c 100644 --- a/clang/lib/Driver/ArgList.cpp +++ b/clang/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; +} |