[clang-tools-extra] [clangd] Allow specifying what headers are always included via "" or <> (PR #67749)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 23:17:29 PST 2024


================
@@ -211,10 +214,12 @@ class IncludeInserter {
   // include path of non-verbatim header will not be shortened.
   IncludeInserter(StringRef FileName, StringRef Code,
                   const format::FormatStyle &Style, StringRef BuildDir,
-                  HeaderSearch *HeaderSearchInfo)
+                  HeaderSearch *HeaderSearchInfo, HeaderFilter QuotedHeaders,
----------------
HighCommander4 wrote:

We're taking `ArrayRef`s here, and passing it `vectors` that live in `Config`.

How confident are we that this is ok from a lifetime point of view, i.e. the `Config` object will outlive the `IncludeInserter` object? How confident are we that this will remain the case across future refactorings?

Would it be better to copy the vector instead? Each element is a function which stores a shared_ptr to a vector of regexes, so we wouldn't be copying the regexes the themselves.

https://github.com/llvm/llvm-project/pull/67749


More information about the cfe-commits mailing list