mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-28 22:20:43 +00:00
Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier.
This lifts the somewhat arbitrary restriction on 3 OptSpecifiers. Differential Revision: http://reviews.llvm.org/D11597 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb745dc50b
commit
de85af6733
@ -259,6 +259,9 @@ public:
|
||||
void AddLastArg(ArgStringList &Output, OptSpecifier Id0,
|
||||
OptSpecifier Id1) const;
|
||||
|
||||
/// AddAllArgs - Render all arguments matching any of the given ids.
|
||||
void AddAllArgs(ArgStringList &Output, ArrayRef<OptSpecifier> Ids) const;
|
||||
|
||||
/// AddAllArgs - Render all arguments matching the given ids.
|
||||
void AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
|
||||
OptSpecifier Id1 = 0U, OptSpecifier Id2 = 0U) const;
|
||||
|
@ -258,6 +258,21 @@ void ArgList::AddLastArg(ArgStringList &Output, OptSpecifier Id0,
|
||||
}
|
||||
}
|
||||
|
||||
void ArgList::AddAllArgs(ArgStringList &Output,
|
||||
ArrayRef<OptSpecifier> Ids) const {
|
||||
for (const Arg *Arg : Args) {
|
||||
for (OptSpecifier Id : Ids) {
|
||||
if (Arg->getOption().matches(Id)) {
|
||||
Arg->claim();
|
||||
Arg->render(*this, Output);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// This 3-opt variant of AddAllArgs could be eliminated in favor of one
|
||||
/// that accepts a single specifier, given the above which accepts any number.
|
||||
void ArgList::AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
|
||||
OptSpecifier Id1, OptSpecifier Id2) const {
|
||||
for (auto Arg: filtered(Id0, Id1, Id2)) {
|
||||
|
Loading…
Reference in New Issue
Block a user