mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
Make AddLastArg() variadic and use it more. No behavior change.
llvm-svn: 364453
This commit is contained in:
parent
6226063b98
commit
01b9e83c3f
@ -301,10 +301,12 @@ public:
|
||||
bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg,
|
||||
bool Default = true) const;
|
||||
|
||||
/// AddLastArg - Render only the last argument match \p Id0, if present.
|
||||
void AddLastArg(ArgStringList &Output, OptSpecifier Id0) const;
|
||||
void AddLastArg(ArgStringList &Output, OptSpecifier Id0,
|
||||
OptSpecifier Id1) const;
|
||||
/// Render only the last argument match \p Id0, if present.
|
||||
template<typename ...OptSpecifiers>
|
||||
void AddLastArg(ArgStringList &Output, OptSpecifiers ...Ids) const {
|
||||
if (Arg *A = getLastArg(Ids...)) // Calls claim() on all Ids's Args.
|
||||
A->render(*this, Output);
|
||||
}
|
||||
|
||||
/// AddAllArgsExcept - Render all arguments matching any of the given ids
|
||||
/// and not matching any of the excluded ids.
|
||||
|
@ -95,21 +95,6 @@ std::vector<std::string> ArgList::getAllArgValues(OptSpecifier Id) const {
|
||||
return std::vector<std::string>(Values.begin(), Values.end());
|
||||
}
|
||||
|
||||
void ArgList::AddLastArg(ArgStringList &Output, OptSpecifier Id) const {
|
||||
if (Arg *A = getLastArg(Id)) {
|
||||
A->claim();
|
||||
A->render(*this, Output);
|
||||
}
|
||||
}
|
||||
|
||||
void ArgList::AddLastArg(ArgStringList &Output, OptSpecifier Id0,
|
||||
OptSpecifier Id1) const {
|
||||
if (Arg *A = getLastArg(Id0, Id1)) {
|
||||
A->claim();
|
||||
A->render(*this, Output);
|
||||
}
|
||||
}
|
||||
|
||||
void ArgList::AddAllArgsExcept(ArgStringList &Output,
|
||||
ArrayRef<OptSpecifier> Ids,
|
||||
ArrayRef<OptSpecifier> ExcludeIds) const {
|
||||
|
Loading…
Reference in New Issue
Block a user