Commit c3a4093
authored
[ADT] Consolidate copyFrom in DenseMap.h (NFC) (llvm#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.1 parent e510797 commit c3a4093
1 file changed
+16
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
423 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
424 | 431 | | |
425 | 432 | | |
426 | 433 | | |
| |||
725 | 732 | | |
726 | 733 | | |
727 | 734 | | |
728 | | - | |
| 735 | + | |
729 | 736 | | |
730 | 737 | | |
731 | 738 | | |
| |||
761 | 768 | | |
762 | 769 | | |
763 | 770 | | |
764 | | - | |
| 771 | + | |
765 | 772 | | |
766 | 773 | | |
767 | 774 | | |
| |||
831 | 838 | | |
832 | 839 | | |
833 | 840 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | 841 | | |
846 | 842 | | |
847 | 843 | | |
| |||
902 | 898 | | |
903 | 899 | | |
904 | 900 | | |
905 | | - | |
| 901 | + | |
906 | 902 | | |
907 | 903 | | |
908 | 904 | | |
| |||
1001 | 997 | | |
1002 | 998 | | |
1003 | 999 | | |
1004 | | - | |
| 1000 | + | |
1005 | 1001 | | |
1006 | 1002 | | |
1007 | 1003 | | |
| |||
1099 | 1095 | | |
1100 | 1096 | | |
1101 | 1097 | | |
1102 | | - | |
| 1098 | + | |
1103 | 1099 | | |
1104 | 1100 | | |
1105 | 1101 | | |
| |||
1108 | 1104 | | |
1109 | 1105 | | |
1110 | 1106 | | |
| 1107 | + | |
1111 | 1108 | | |
1112 | 1109 | | |
1113 | 1110 | | |
| |||
1116 | 1113 | | |
1117 | 1114 | | |
1118 | 1115 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | 1116 | | |
1127 | 1117 | | |
1128 | 1118 | | |
| |||
0 commit comments