[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
Wed Aug 31 08:26:22 PDT 2016

grimar added inline comments.

Comment at: ELF/LinkerScript.cpp:907-912
@@ -903,8 +906,8 @@
-std::vector<StringRef> ScriptParser::readInputFilePatterns() {
-  std::vector<StringRef> V;
+std::vector<Regex> ScriptParser::readInputFilePatterns() {
+  std::vector<Regex> V;
   while (!Error && !skip(")"))
-    V.push_back(next());
+    V.push_back(compileGlobPattern(next()));
   return V;
ruiu wrote:
> Why don't you add a constructor with no arguments to llvm::Regex?
OK, I can do that. What do you think about const_casts this patch introduces ?
We can either avoid using const llvm::Regex references to be able to use non-const match or reimplement llvm::Regex to be able to make match() const.


More information about the llvm-commits mailing list