forked from OSchip/llvm-project
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
This commit is contained in:
parent
190064ad0d
commit
63e3a29ff3
|
@ -187,6 +187,7 @@ public:
|
|||
///
|
||||
/// \p Claim Whether the argument should be claimed, if it exists.
|
||||
Arg *getLastArgNoClaim(OptSpecifier Id) const;
|
||||
Arg *getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1) const;
|
||||
Arg *getLastArg(OptSpecifier Id) const;
|
||||
Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1) const;
|
||||
Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue