[lld] r274103 - Rename matchStr -> globMatch.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 22:32:09 PDT 2016


Author: ruiu
Date: Wed Jun 29 00:32:09 2016
New Revision: 274103

URL: http://llvm.org/viewvc/llvm-project?rev=274103&view=rev
Log:
Rename matchStr -> globMatch.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/LinkerScript.h
    lld/trunk/ELF/SymbolTable.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=274103&r1=274102&r2=274103&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Wed Jun 29 00:32:09 2016
@@ -186,7 +186,7 @@ uint64_t ExprParser::parseExpr() { retur
 template <class ELFT>
 StringRef LinkerScript<ELFT>::getOutputSection(InputSectionBase<ELFT> *S) {
   for (SectionRule &R : Opt.Sections)
-    if (matchStr(R.SectionPattern, S->getSectionName()))
+    if (globMatch(R.SectionPattern, S->getSectionName()))
       return R.Dest;
   return "";
 }
@@ -199,7 +199,7 @@ bool LinkerScript<ELFT>::isDiscarded(Inp
 template <class ELFT>
 bool LinkerScript<ELFT>::shouldKeep(InputSectionBase<ELFT> *S) {
   for (StringRef Pat : Opt.KeptSections)
-    if (matchStr(Pat, S->getSectionName()))
+    if (globMatch(Pat, S->getSectionName()))
       return true;
   return false;
 }
@@ -289,7 +289,7 @@ int LinkerScript<ELFT>::compareSections(
 // Returns true if S matches T. S can contain glob meta-characters.
 // The asterisk ('*') matches zero or more characters, and the question
 // mark ('?') matches one character.
-bool elf::matchStr(StringRef S, StringRef T) {
+bool elf::globMatch(StringRef S, StringRef T) {
   for (;;) {
     if (S.empty())
       return T.empty();
@@ -299,7 +299,7 @@ bool elf::matchStr(StringRef S, StringRe
         // Fast path. If a pattern is '*', it matches anything.
         return true;
       for (size_t I = 0, E = T.size(); I < E; ++I)
-        if (matchStr(S, T.substr(I)))
+        if (globMatch(S, T.substr(I)))
           return true;
       return false;
     }

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=274103&r1=274102&r2=274103&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Wed Jun 29 00:32:09 2016
@@ -19,7 +19,7 @@
 namespace lld {
 namespace elf {
 
-bool matchStr(StringRef S, StringRef T);
+bool globMatch(StringRef S, StringRef T);
 
 // Parses a linker script. Calling this function updates
 // Config and ScriptConfig.

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=274103&r1=274102&r2=274103&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Jun 29 00:32:09 2016
@@ -473,7 +473,7 @@ std::vector<SymbolBody *> SymbolTable<EL
   for (auto &It : Symtab) {
     StringRef Name = It.first.Val;
     SymbolBody *B = SymVector[It.second]->body();
-    if (!B->isUndefined() && matchStr(Pattern, Name))
+    if (!B->isUndefined() && globMatch(Pattern, Name))
       Res.push_back(B);
   }
   return Res;




More information about the llvm-commits mailing list