[PATCH] D26241: [ELF] Speed-up lld up to 5 times by replacing llvm:regex with simple string matcher.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 11:09:07 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/Strings.h:32-33
+ StringMatcher() = default;
+ StringMatcher(StringRef P) : Patterns({P}) {}
+ StringMatcher(std::vector<StringRef> &&Pat)
+ : Patterns(std::forward<std::vector<StringRef>>(Pat)) {}
----------------
Add `explicit`.
================
Comment at: ELF/Strings.h:36
+
+ bool match(StringRef S) {
+ for (StringRef P : Patterns)
----------------
Move this definition to Strings.cpp and make globMatch static, so that we can keep globMatch inside a file-scope.
================
Comment at: ELF/Strings.h:42
+ }
+ std::vector<StringRef> Patterns;
+};
----------------
Make this private.
Repository:
rL LLVM
https://reviews.llvm.org/D26241
More information about the llvm-commits
mailing list