[PATCH] D23829: [ELF] - Use std::regex instead of hand written logic in elf::globMatch()

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 14:06:21 PDT 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with all these changes.


================
Comment at: ELF/Strings.cpp:51
@@ +50,3 @@
+// Takes multiple glob patterns and converts them into regex object.
+Regex elf::compileGlobPatterns(ArrayRef<StringRef> P) {
+  std::string T = "^(" + toRegex(P[0]);
----------------
Why `P`? I believe we usually use `V` or `Arr` for an ArrayRef.

================
Comment at: ELF/SymbolTable.cpp:486
@@ -485,3 +485,3 @@
 
 // Returns a list of defined symbols that match with a given glob pattern.
 template <class ELFT>
----------------
given regex.

================
Comment at: ELF/SymbolTable.h:95
@@ -93,3 +94,3 @@
 private:
-  std::vector<SymbolBody *> findAll(StringRef Pattern);
+  std::vector<SymbolBody *> findAll(const llvm::Regex &Pattern);
   std::pair<Symbol *, bool> insert(StringRef &Name);
----------------
Pattern -> Re (Please be consistent with naming.)


https://reviews.llvm.org/D23829





More information about the llvm-commits mailing list