[PATCH] D69313: Handle more crt*.o filename variants.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 12:30:29 PDT 2019


ruiu added inline comments.


================
Comment at: lld/ELF/OutputSections.cpp:396
+  static std::regex re(R"((clang_rt\.)?crtbegin[ST]?(-.*)?\.o)");
+  std::string F = sys::path::filename(s);
+  return std::regex_match(F, re);
----------------
I believe you can avoid creating a copy of a string here. Does something like this work?

  s = sys::path::filename(s);
  return std::regex_match(s.begin(), s.end(), re);


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69313/new/

https://reviews.llvm.org/D69313





More information about the llvm-commits mailing list