[clang-tools-extra] [clangd] Track IWYU pragmas for non-preamble includes (PR #75612)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 10:35:00 PST 2023


================
@@ -113,7 +113,7 @@ class PragmaIncludes {
   llvm::DenseSet<llvm::sys::fs::UniqueID> ShouldKeep;
 
   /// Owns the strings.
-  llvm::BumpPtrAllocator Arena;
+  std::shared_ptr<llvm::BumpPtrAllocator> Arena;
----------------
sam-mccall wrote:

This doesn't look threadsafe. Two PIs associated with parallel ParsedAST builds will write into the same arena.

You could do some trick with shared_ptr<void> to keep all needed arenas alive, and a raw pointer to the current, I guess?

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


More information about the cfe-commits mailing list