You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ADT] Consolidate copyFrom in DenseMap.h (NFC) (#165101)
DenseMap.h has:
- DenseMapBase::copyFrom
- DenseMap::copyFrom
- SmallDenseMap::copyFrom
The latter two clear and set up the storage again before delegating
DenseMapBase::copyFrom to do the actual work of copying buckets.
This patch consolidates all these into DenseMapBase::copyFrom while
eliminating name shadowing concerns. Note that DenseMap::copyFrom and
SmallDenseMap::copyFrom are nearly identical, and they can be made
identical with small adjustments:
- Set NumEntries and NumTombstones to 0 unconditionally.
- Teach SmallDenseMap::allocateBuckets to always return true.
This patch essentially applies these adjustments and then "inlines"
the identical function body to the beginning of
DenseMapBase::copyFrom.
This patch de-templatizes DenseMapBase::copyFrom because nobody calls
it with any type other than DerivedT.
0 commit comments