diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-12 19:42:53 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-12 19:42:53 +0000 |
commit | 63e3a29ff3e4050e615a56127b7789cdc15f520f (patch) | |
tree | 3d54b5f00939881bc1c4140396393f5c463bfedf /llvm/lib/Option/ArgList.cpp | |
parent | 190064ad0d122e68caca080014b2640ee883f3b6 (diff) | |
download | llvm-63e3a29ff3e4050e615a56127b7789cdc15f520f.zip llvm-63e3a29ff3e4050e615a56127b7789cdc15f520f.tar.gz llvm-63e3a29ff3e4050e615a56127b7789cdc15f520f.tar.bz2 |
Add an overload of getLastArgNoClaim taking two OptSpecifiers.
Summary: This will be used in clang.
Test Plan: Will be tested on the clang side.
Reviewers: hansw
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5337
llvm-svn: 217702
Diffstat (limited to 'llvm/lib/Option/ArgList.cpp')
-rw-r--r-- | llvm/lib/Option/ArgList.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Option/ArgList.cpp b/llvm/lib/Option/ArgList.cpp index 5848bb1..041e552 100644 --- a/llvm/lib/Option/ArgList.cpp +++ b/llvm/lib/Option/ArgList.cpp @@ -54,6 +54,15 @@ Arg *ArgList::getLastArgNoClaim(OptSpecifier Id) const { return nullptr; } +Arg *ArgList::getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1) const { + // FIXME: Make search efficient? + for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it) + if ((*it)->getOption().matches(Id0) || + (*it)->getOption().matches(Id1)) + return *it; + return nullptr; +} + Arg *ArgList::getLastArg(OptSpecifier Id) const { Arg *Res = nullptr; for (const_iterator it = begin(), ie = end(); it != ie; ++it) { |