[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:13:37 PDT 2016


ruiu added inline comments.

================
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]);
----------------
ruiu wrote:
> grimar wrote:
> > ruiu wrote:
> > > Why `P`? I believe we usually use `V` or `Arr` for an ArrayRef.
> > Because Patterns. Actually choosed between V and P. Will switch to P then.
> Actually I found that it is easy to read if you name variables of a small scope according to it's type rather than what the variable has, so please stick with V or Arr.
We know that the argument is an array of glob patterns. Because the function name and the comment says so. But if you name it `P`, it'd make everybody wonder what `P` is. At least, it doesn't make much sense to me.


https://reviews.llvm.org/D23829





More information about the llvm-commits mailing list