[PATCH] D154014: [SpecialCaseList] Use Globs instead of Regex

Ellis Hoag via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 16:37:21 PDT 2023


ellis created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
ellis edited the summary of this revision.
ellis added reviewers: MaskRay, phosek, vitalybuka, samsonov, hctim.
ellis updated this revision to Diff 535560.
ellis added a comment.
ellis published this revision for review.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Fix ProfileList


Switch `SpecialCaseList` from using Regex to Globs to match patterns. `GlobPattern` was extended in https://reviews.llvm.org/D153587 to support brace expansions which allows us to use patterns like `*/src/foo.{c,cpp}`. It turns out that most patterns only use `*` to match any string and a few special cases use brace expansions, so using Regex was overkill and required lots of escaping in practice.

This is a breaking change since some SCLs might use `.*` or `(abc|def)` which are supported regexes but not valid globs. Since we have just cut clang 16.x this is a good time to make this change.

See discussion in https://reviews.llvm.org/D152762


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154014

Files:
  clang/docs/SanitizerSpecialCaseList.rst
  clang/lib/Basic/ProfileList.cpp
  clang/lib/Basic/SanitizerSpecialCaseList.cpp
  llvm/include/llvm/Support/SpecialCaseList.h
  llvm/lib/Support/SpecialCaseList.cpp
  llvm/unittests/Support/SpecialCaseListTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154014.535560.patch
Type: text/x-patch
Size: 25077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230628/a78257a5/attachment-0001.bin>


More information about the cfe-commits mailing list