================
@@ -62,10 +71,32 @@ class DuplicateIncludeCallbacks : public PPCallbacks {
   SmallVector<FileList> Files;
   DuplicateIncludeCheck &Check;
   const SourceManager &SM;
+  std::vector<llvm::Regex> AllowedRegexes;
+
+  bool isAllowedDuplicate(StringRef FileName, OptionalFileEntryRef File) const 
{
+    if (llvm::any_of(AllowedRegexes,
+                     [&](const llvm::Regex &R) { return R.match(FileName); }))
+      return true;
+
+    if (File) {
+      const StringRef Resolved = File->getName();
+      if (llvm::any_of(AllowedRegexes,
----------------
vbvictor wrote:

we can just `return any_of(..)` here

https://github.com/llvm/llvm-project/pull/168196
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to