[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:28:01 PDT 2016


grimar added inline comments.

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

T += "\\" + F;

================
Comment at: test/ELF/wildcards2.s:18
@@ +17,3 @@
+# RUN:   %s -o %T/aaa.foo(+${}^bar).o
+# RUN: echo "SECTIONS { .text : { \"*aaa.foo(+${}^bar).o\"(.abc) } }" > %t2.script
+# RUN: ld.lld -o %t.out --script %t2.script %T/aaa.foo(+${}^bar).o
----------------
ruiu wrote:
> grimar wrote:
> > It is not possible to create file with "|" "/" or "\" in name, so this is not tested here.
> You don't need to test this this vigorously. It is too easy to break on minor filesystems. Add a test just for `.`.
Done.


https://reviews.llvm.org/D23829





More information about the llvm-commits mailing list