llvm.org GIT mirror llvm / 97688c4
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217702 91177308-0d34-0410-b5e6-96231b3b80d8 Ehsan Akhgari 6 years ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
186186 ///
187187 /// \p Claim Whether the argument should be claimed, if it exists.
188188 Arg *getLastArgNoClaim(OptSpecifier Id) const;
189 Arg *getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1) const;
189190 Arg *getLastArg(OptSpecifier Id) const;
190191 Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1) const;
191192 Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const;
5353 return nullptr;
5454 }
5555
56 Arg *ArgList::getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1) const {
57 // FIXME: Make search efficient?
58 for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it)
59 if ((*it)->getOption().matches(Id0) ||
60 (*it)->getOption().matches(Id1))
61 return *it;
62 return nullptr;
63 }
64
5665 Arg *ArgList::getLastArg(OptSpecifier Id) const {
5766 Arg *Res = nullptr;
5867 for (const_iterator it = begin(), ie = end(); it != ie; ++it) {