[llvm] [ADT] Make DenseMapBase::moveFrom safer (NFC) (PR #168180)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 15 05:35:23 PST 2025
================
@@ -1107,6 +1118,13 @@ class SmallDenseMap
this->BaseT::initEmpty();
}
+ // Put the zombie instance in a known good state after a move.
+ void kill() {
+ deallocateBuckets();
+ Small = false;
+ new (getLargeRep()) LargeRep{nullptr, 0};
----------------
kuhar wrote:
could we make it small and avoid allocating a large state?
https://github.com/llvm/llvm-project/pull/168180
More information about the llvm-commits
mailing list