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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 13:20:17 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Strings.cpp:35-36
@@ +34,4 @@
+  std::string T;
+  while (!S.empty()) {
+    char F = S.front();
+    if (F == '*')
----------------
ruiu wrote:
>   for (char F : S)
> 
> By the way, why `F`?
Front. Do you prefer other name ?

================
Comment at: ELF/Strings.cpp:42
@@ +41,3 @@
+    else if (StringRef(&F, 1).find_first_of(".+^${}()|/\\[]") != StringRef::npos)
+      T += std::string("\\") + F;
+    else
----------------
ruiu wrote:
> What is this std::string() for?
"\\" is a pointer to char. 
+ F just moves that pointer, but I need concatenation of string.


https://reviews.llvm.org/D23829





More information about the llvm-commits mailing list