[clang-tools-extra] [clang-tidy] Improved --verify-config when using literal style in config file (PR #85591)
Danny Mösch via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 24 07:29:52 PDT 2024
================
@@ -454,52 +454,31 @@ static constexpr StringLiteral VerifyConfigWarningEnd = " [-verify-config]\n";
static bool verifyChecks(const StringSet<> &AllChecks, StringRef CheckGlob,
StringRef Source) {
- llvm::StringRef Cur, Rest;
+ GlobList Globs(CheckGlob);
bool AnyInvalid = false;
- for (std::tie(Cur, Rest) = CheckGlob.split(',');
- !(Cur.empty() && Rest.empty()); std::tie(Cur, Rest) = Rest.split(',')) {
- Cur = Cur.trim();
- if (Cur.empty())
+ for (const auto &Item : Globs.getItems()) {
+ const llvm::Regex &Reg = Item.Regex;
+ const llvm::StringRef Text = Item.Text;
----------------
SimplyDanny wrote:
Fine from my point of view to inline both of these variables as it doesn't improve much to have them. If you insist to keep them, use them wherever `Item.` appears.
https://github.com/llvm/llvm-project/pull/85591
More information about the cfe-commits
mailing list