================
@@ -163,15 +184,15 @@ using FactID = unsigned short;
 /// the analysis of a single routine.
 class FactManager {
 private:
-  std::vector<std::unique_ptr<const FactEntry>> Facts;
+  std::vector<std::unique_ptr<FactEntry>> Facts;
----------------
aaronpuchert wrote:

The FactEntries themselves should never be replaced, they are immutable. What 
you're doing now (correctly) is to replace the `FactID` indices in a `FactSet`. 
But maybe that is what you meant.

They should probably not be stored in a `std::unique_ptr` but be allocated via 
`BumpPtrAllocator`, but that's unrelated to your change. I've also thought 
about putting them in a `std::variant`, but I think an arena might be even 
better.

Yes, copying them is a bit inefficient, but I expect reentrancy within a single 
function to be pretty rare. So we can probably pay the price. What makes the 
analysis costly is mostly looking at things that have nothing to do with thread 
safety.

https://github.com/llvm/llvm-project/pull/137133
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to