Fix parameter names.
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
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index c098ee6..333c467 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -67,9 +67,9 @@
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;
}
@@ -109,7 +109,7 @@
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