Skip to content

Commit

Permalink
ArgList: Simplify 3-opt overload of AddAllArgs. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Oct 12, 2023
1 parent 97cd39f commit af74f06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions llvm/include/llvm/Option/ArgList.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ class ArgList {
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;
void AddAllArgs(ArgStringList &Output, OptSpecifier Id0) const;

/// AddAllArgValues - Render the argument values of all arguments
/// matching the given ids.
Expand Down
7 changes: 2 additions & 5 deletions llvm/lib/Option/ArgList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,8 @@ void ArgList::addAllArgs(ArgStringList &Output,
AddAllArgsExcept(Output, Ids, Exclude);
}

/// 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)) {
void ArgList::AddAllArgs(ArgStringList &Output, OptSpecifier Id0) const {
for (auto *Arg : filtered(Id0)) {
Arg->claim();
Arg->render(*this, Output);
}
Expand Down

0 comments on commit af74f06

Please sign in to comment.