|
21 | 21 | #ifndef LLVM_ADT_SPARSEMULTISET_H |
22 | 22 | #define LLVM_ADT_SPARSEMULTISET_H |
23 | 23 |
|
| 24 | +#include "llvm/ADT/STLForwardCompat.h" |
24 | 25 | #include "llvm/ADT/SmallVector.h" |
25 | 26 | #include "llvm/ADT/SparseSet.h" |
26 | | -#include "llvm/ADT/identity.h" |
27 | 27 | #include <cassert> |
28 | 28 | #include <cstdint> |
29 | 29 | #include <cstdlib> |
@@ -77,11 +77,12 @@ namespace llvm { |
77 | 77 | /// intuitive and fast removal. |
78 | 78 | /// |
79 | 79 | /// @tparam ValueT The type of objects in the set. |
| 80 | +/// @tparam KeyT The type of the key that identifies objects in the set. |
80 | 81 | /// @tparam KeyFunctorT A functor that computes an unsigned index from KeyT. |
81 | 82 | /// @tparam SparseT An unsigned integer type. See above. |
82 | 83 | /// |
83 | | -template <typename ValueT, typename KeyFunctorT = identity<unsigned>, |
84 | | - typename SparseT = uint8_t> |
| 84 | +template <typename ValueT, typename KeyT = unsigned, |
| 85 | + typename KeyFunctorT = identity_cxx20, typename SparseT = uint8_t> |
85 | 86 | class SparseMultiSet { |
86 | 87 | static_assert(std::is_unsigned_v<SparseT>, |
87 | 88 | "SparseT must be an unsigned integer type"); |
@@ -112,7 +113,6 @@ class SparseMultiSet { |
112 | 113 | bool isValid() const { return Prev != INVALID; } |
113 | 114 | }; |
114 | 115 |
|
115 | | - using KeyT = typename KeyFunctorT::argument_type; |
116 | 116 | using DenseT = SmallVector<SMSNode, 8>; |
117 | 117 | DenseT Dense; |
118 | 118 | SparseT *Sparse = nullptr; |
|
0 commit comments