[lld] r276705 - Fix parameter names.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 15:41:42 PDT 2016


Author: ruiu
Date: Mon Jul 25 17:41:42 2016
New Revision: 276705

URL: http://llvm.org/viewvc/llvm-project?rev=276705&view=rev
Log:
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.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=276705&r1=276704&r2=276705&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Jul 25 17:41:42 2016
@@ -67,9 +67,9 @@ bool LinkerScript<ELFT>::shouldKeep(Inpu
   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 @@ LinkerScript<ELFT>::createSections(Outpu
           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




More information about the llvm-commits mailing list