Skip to content

Commit

Permalink
Fix parameter names.
Browse files Browse the repository at this point in the history
match() returns true of the first argument, a target string, matches
one of the second argument, a list of glob patterns. Calling the
target string, which is not a glob pattern, "Pattern" was very confusing.

llvm-svn: 276705
  • Loading branch information
rui314 committed Jul 25, 2016
1 parent 4c59714 commit 63dc650
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lld/ELF/LinkerScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ bool LinkerScript<ELFT>::shouldKeep(InputSectionBase<ELFT> *S) {
return false;
}

static bool match(StringRef Pattern, ArrayRef<StringRef> Arr) {
for (StringRef S : Arr)
if (globMatch(S, Pattern))
static bool match(ArrayRef<StringRef> Patterns, StringRef S) {
for (StringRef Pat : Patterns)
if (globMatch(Pat, S))
return true;
return false;
}
Expand Down Expand Up @@ -109,7 +109,7 @@ LinkerScript<ELFT>::createSections(OutputSectionFactory<ELFT> &Factory) {
if (isDiscarded(S) || S->OutSec)
continue;

if (match(S->getSectionName(), InCmd->Patterns)) {
if (match(InCmd->Patterns, S->getSectionName())) {
if (OutCmd->Name == "/DISCARD/")
S->Live = false;
else
Expand Down

0 comments on commit 63dc650

Please sign in to comment.