Lines Matching defs:KeyT

41 template <typename KeyT, typename ValueT>
42 struct DenseMapPair : public std::pair<KeyT, ValueT> {
43 using std::pair<KeyT, ValueT>::pair;
45 KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
46 const KeyT &getFirst() const { return std::pair<KeyT, ValueT>::first; }
47 ValueT &getSecond() { return std::pair<KeyT, ValueT>::second; }
48 const ValueT &getSecond() const { return std::pair<KeyT, ValueT>::second; }
53 template <typename KeyT, typename ValueT,
54 typename KeyInfoT = DenseMapInfo<KeyT>,
55 typename Bucket = llvm::detail::DenseMapPair<KeyT, ValueT>,
59 template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
67 using key_type = KeyT;
71 using iterator = DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT>;
73 DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT, true>;
80 if (shouldReverseIterate<KeyT>())
90 if (shouldReverseIterate<KeyT>())
122 const KeyT EmptyKey = getEmptyKey();
128 const KeyT TombstoneKey = getTombstoneKey();
147 bool contains(const_arg_type_t<KeyT> Val) const {
152 size_type count(const_arg_type_t<KeyT> Val) const {
156 iterator find(const_arg_type_t<KeyT> Val) {
159 Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
163 const_iterator find(const_arg_type_t<KeyT> Val) const {
166 Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
174 /// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key
179 Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
187 Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
194 ValueT lookup(const_arg_type_t<KeyT> Val) const {
202 const ValueT &at(const_arg_type_t<KeyT> Val) const {
211 std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
218 std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
226 std::pair<iterator, bool> try_emplace(KeyT &&Key, Ts &&...Args) {
230 shouldReverseIterate<KeyT>()
240 shouldReverseIterate<KeyT>()
251 std::pair<iterator, bool> try_emplace(const KeyT &Key, Ts &&...Args) {
255 shouldReverseIterate<KeyT>()
264 shouldReverseIterate<KeyT>()
274 /// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key
277 std::pair<iterator, bool> insert_as(std::pair<KeyT, ValueT> &&KV,
282 shouldReverseIterate<KeyT>()
292 shouldReverseIterate<KeyT>()
306 std::pair<iterator, bool> insert_or_assign(const KeyT &Key, V &&Val) {
314 std::pair<iterator, bool> insert_or_assign(KeyT &&Key, V &&Val) {
321 bool erase(const KeyT &Val) {
340 ValueT &operator[](const KeyT &Key) {
348 ValueT &operator[](KeyT &&Key) {
375 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
380 P->getFirst().~KeyT();
390 const KeyT EmptyKey = getEmptyKey();
392 ::new (&B->getFirst()) KeyT(EmptyKey);
410 const KeyT EmptyKey = getEmptyKey();
411 const KeyT TombstoneKey = getTombstoneKey();
427 B->getFirst().~KeyT();
433 const DenseMapBase<OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT> &other) {
443 if constexpr (std::is_trivially_copyable_v<KeyT> &&
448 const KeyT EmptyKey = getEmptyKey();
449 const KeyT TombstoneKey = getTombstoneKey();
451 ::new (&Buckets[I].getFirst()) KeyT(OtherBuckets[I].getFirst());
459 static unsigned getHashValue(const KeyT &Val) {
468 static const KeyT getEmptyKey() {
474 static const KeyT getTombstoneKey() { return KeyInfoT::getTombstoneKey(); }
479 if (shouldReverseIterate<KeyT>()) {
489 if (shouldReverseIterate<KeyT>()) {
551 BucketT *InsertIntoBucketWithLookup(BucketT *TheBucket, KeyT &&Key,
592 const KeyT EmptyKey = getEmptyKey();
605 const KeyT EmptyKey = getEmptyKey();
643 const KeyT EmptyKey = getEmptyKey();
644 const KeyT TombstoneKey = getTombstoneKey();
695 template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
698 const DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT> &LHS,
699 const DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT> &RHS) {
715 template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
718 const DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT> &LHS,
719 const DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT> &RHS) {
723 template <typename KeyT, typename ValueT,
724 typename KeyInfoT = DenseMapInfo<KeyT>,
725 typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
726 class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
727 KeyT, ValueT, KeyInfoT, BucketT> {
728 friend class DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
732 using BaseT = DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
877 template <typename KeyT, typename ValueT, unsigned InlineBuckets = 4,
878 typename KeyInfoT = DenseMapInfo<KeyT>,
879 typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
882 SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>, KeyT,
884 friend class DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
888 using BaseT = DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
943 const KeyT EmptyKey = this->getEmptyKey();
944 const KeyT TombstoneKey = this->getTombstoneKey();
994 ::new (&NewB->getFirst()) KeyT(std::move(OldB->getFirst()));
995 OldB->getFirst().~KeyT();
1055 const KeyT EmptyKey = this->getEmptyKey();
1056 const KeyT TombstoneKey = this->getTombstoneKey();
1062 ::new (&TmpEnd->getFirst()) KeyT(std::move(P->getFirst()));
1067 P->getFirst().~KeyT();
1187 template <typename KeyT, typename ValueT, typename KeyInfoT, typename Bucket,
1190 friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true>;
1191 friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, false>;
1214 if (shouldReverseIterate<KeyT>()) {
1227 const DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConstSrc> &I)
1233 if (shouldReverseIterate<KeyT>())
1240 if (shouldReverseIterate<KeyT>())
1262 if (shouldReverseIterate<KeyT>()) {
1281 const KeyT Empty = KeyInfoT::getEmptyKey();
1282 const KeyT Tombstone = KeyInfoT::getTombstoneKey();
1291 const KeyT Empty = KeyInfoT::getEmptyKey();
1292 const KeyT Tombstone = KeyInfoT::getTombstoneKey();
1300 template <typename KeyT, typename ValueT, typename KeyInfoT>
1301 inline size_t capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {