[PATCH] D123488: [clangd] IncludeCleaner: Add filtering mechanism

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 01:59:17 PDT 2022


sammccall added a comment.

Not to fix in this patch, but the move constructor of llvm::Regex is suspicious - there's no move assignment operator.
This putting them in a vector seems likely to copy them when the vector reallocates. Think you could fix this? :-)



================
Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:527
+        diag(Warning,
+             llvm::formatv("Invalid regular expression: {0}", *HeaderPattern)
+                 .str(),
----------------
missing the error message


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:242
+    const Inclusion &Inc, ParsedAST &AST,
+    llvm::ArrayRef<std::function<bool(llvm::StringRef)>> HeaderFilters) {
   if (Inc.BehindPragmaKeep)
----------------
maybe just pass in config?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123488



More information about the cfe-commits mailing list