This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Reimplement GlobList without relying on Regex.
Needs ReviewPublic

Authored by njames93 on Jul 13 2022, 4:44 PM.

Details

Summary

Regex is a little cumbersome for the limited syntax GlobList supports and its implementation is a bit of a hack.
Added some convenience methods that will be useful in follow up patches

Diff Detail

Event Timeline

njames93 created this revision.Jul 13 2022, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 4:44 PM
njames93 requested review of this revision.Jul 13 2022, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 4:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
njames93 updated this revision to Diff 444457.Jul 13 2022, 4:50 PM

Fix comments.

njames93 updated this revision to Diff 444786.Jul 14 2022, 1:41 PM

Added functionality for Checking equivalence to a StringRef without having to build the Glob.

These features are ground work for upcoming patches.

njames93 updated this revision to Diff 444820.Jul 14 2022, 3:39 PM

More code cleanup.

njames93 updated this revision to Diff 445464.Jul 18 2022, 5:23 AM

Enable escaping the leading - at the start of a glob to match strings starting with a -.

njames93 updated this revision to Diff 445469.Jul 18 2022, 5:55 AM

Ensure escaped negatives are printed correctly.

njames93 updated this revision to Diff 446097.Jul 20 2022, 3:04 AM

Improve handling of consecutive wild cards.

njames93 retitled this revision from [NFCI][clang-tidy] Reimplement GlobList without relying on Regex. to [clang-tidy] Reimplement GlobList without relying on Regex..Jul 22 2022, 4:46 AM
njames93 edited the summary of this revision. (Show Details)

A litte overkill, there is llvm/include/llvm/Support/GlobPattern.h that could be used to simplify this code.