LLVM 18.0.0git
StringMap.h
Go to the documentation of this file.
1//===- StringMap.h - String Hash table map interface ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines the StringMap class.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_ADT_STRINGMAP_H
15#define LLVM_ADT_STRINGMAP_H
16
18#include "llvm/ADT/iterator.h"
21#include <initializer_list>
22#include <iterator>
23
24namespace llvm {
25
26template <typename ValueTy> class StringMapConstIterator;
27template <typename ValueTy> class StringMapIterator;
28template <typename ValueTy> class StringMapKeyIterator;
29
30/// StringMapImpl - This is the base class of StringMap that is shared among
31/// all of its instantiations.
33protected:
34 // Array of NumBuckets pointers to entries, null pointers are holes.
35 // TheTable[NumBuckets] contains a sentinel value for easy iteration. Followed
36 // by an array of the actual hash values as unsigned integers.
38 unsigned NumBuckets = 0;
39 unsigned NumItems = 0;
40 unsigned NumTombstones = 0;
41 unsigned ItemSize;
42
43protected:
44 explicit StringMapImpl(unsigned itemSize) : ItemSize(itemSize) {}
49 RHS.TheTable = nullptr;
50 RHS.NumBuckets = 0;
51 RHS.NumItems = 0;
52 RHS.NumTombstones = 0;
53 }
54
55 StringMapImpl(unsigned InitSize, unsigned ItemSize);
56 unsigned RehashTable(unsigned BucketNo = 0);
57
58 /// LookupBucketFor - Look up the bucket that the specified string should end
59 /// up in. If it already exists as a key in the map, the Item pointer for the
60 /// specified bucket will be non-null. Otherwise, it will be null. In either
61 /// case, the FullHashValue field of the bucket will be set to the hash value
62 /// of the string.
63 unsigned LookupBucketFor(StringRef Key);
64
65 /// FindKey - Look up the bucket that contains the specified key. If it exists
66 /// in the map, return the bucket number of the key. Otherwise return -1.
67 /// This does not modify the map.
68 int FindKey(StringRef Key) const;
69
70 /// RemoveKey - Remove the specified StringMapEntry from the table, but do not
71 /// delete it. This aborts if the value isn't in the table.
73
74 /// RemoveKey - Remove the StringMapEntry for the specified key from the
75 /// table, returning it. If the key is not in the table, this returns null.
77
78 /// Allocate the table with the specified number of buckets and otherwise
79 /// setup the map as empty.
80 void init(unsigned Size);
81
82public:
83 static constexpr uintptr_t TombstoneIntVal =
84 static_cast<uintptr_t>(-1)
86
88 return reinterpret_cast<StringMapEntryBase *>(TombstoneIntVal);
89 }
90
91 unsigned getNumBuckets() const { return NumBuckets; }
92 unsigned getNumItems() const { return NumItems; }
93
94 bool empty() const { return NumItems == 0; }
95 unsigned size() const { return NumItems; }
96
98 std::swap(TheTable, Other.TheTable);
99 std::swap(NumBuckets, Other.NumBuckets);
100 std::swap(NumItems, Other.NumItems);
101 std::swap(NumTombstones, Other.NumTombstones);
102 }
103};
104
105/// StringMap - This is an unconventional map that is specialized for handling
106/// keys that are "strings", which are basically ranges of bytes. This does some
107/// funky memory allocation and hashing things to make it extremely efficient,
108/// storing the string data *after* the value in the map.
109template <typename ValueTy, typename AllocatorTy = MallocAllocator>
111 : public StringMapImpl,
112 private detail::AllocatorHolder<AllocatorTy> {
114
115public:
117
118 StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
119
120 explicit StringMap(unsigned InitialSize)
121 : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
122
123 explicit StringMap(AllocatorTy A)
124 : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))), AllocTy(A) {}
125
126 StringMap(unsigned InitialSize, AllocatorTy A)
127 : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))),
128 AllocTy(A) {}
129
130 StringMap(std::initializer_list<std::pair<StringRef, ValueTy>> List)
131 : StringMapImpl(List.size(), static_cast<unsigned>(sizeof(MapEntryTy))) {
132 insert(List);
133 }
134
136 : StringMapImpl(std::move(RHS)), AllocTy(std::move(RHS.getAllocator())) {}
137
139 : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))),
140 AllocTy(RHS.getAllocator()) {
141 if (RHS.empty())
142 return;
143
144 // Allocate TheTable of the same size as RHS's TheTable, and set the
145 // sentinel appropriately (and NumBuckets).
146 init(RHS.NumBuckets);
147 unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1),
148 *RHSHashTable = (unsigned *)(RHS.TheTable + NumBuckets + 1);
149
150 NumItems = RHS.NumItems;
151 NumTombstones = RHS.NumTombstones;
152 for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
153 StringMapEntryBase *Bucket = RHS.TheTable[I];
154 if (!Bucket || Bucket == getTombstoneVal()) {
155 TheTable[I] = Bucket;
156 continue;
157 }
158
159 TheTable[I] = MapEntryTy::create(
160 static_cast<MapEntryTy *>(Bucket)->getKey(), getAllocator(),
161 static_cast<MapEntryTy *>(Bucket)->getValue());
162 HashTable[I] = RHSHashTable[I];
163 }
164
165 // Note that here we've copied everything from the RHS into this object,
166 // tombstones included. We could, instead, have re-probed for each key to
167 // instantiate this new object without any tombstone buckets. The
168 // assumption here is that items are rarely deleted from most StringMaps,
169 // and so tombstones are rare, so the cost of re-probing for all inputs is
170 // not worthwhile.
171 }
172
174 StringMapImpl::swap(RHS);
175 std::swap(getAllocator(), RHS.getAllocator());
176 return *this;
177 }
178
180 // Delete all the elements in the map, but don't reset the elements
181 // to default values. This is a copy of clear(), but avoids unnecessary
182 // work not required in the destructor.
183 if (!empty()) {
184 for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
185 StringMapEntryBase *Bucket = TheTable[I];
186 if (Bucket && Bucket != getTombstoneVal()) {
187 static_cast<MapEntryTy *>(Bucket)->Destroy(getAllocator());
188 }
189 }
190 }
191 free(TheTable);
192 }
193
194 using AllocTy::getAllocator;
195
196 using key_type = const char *;
197 using mapped_type = ValueTy;
199 using size_type = size_t;
200
203
204 iterator begin() { return iterator(TheTable, NumBuckets == 0); }
205 iterator end() { return iterator(TheTable + NumBuckets, true); }
207 return const_iterator(TheTable, NumBuckets == 0);
208 }
210 return const_iterator(TheTable + NumBuckets, true);
211 }
212
216 }
217
219 int Bucket = FindKey(Key);
220 if (Bucket == -1)
221 return end();
222 return iterator(TheTable + Bucket, true);
223 }
224
226 int Bucket = FindKey(Key);
227 if (Bucket == -1)
228 return end();
229 return const_iterator(TheTable + Bucket, true);
230 }
231
232 /// lookup - Return the entry for the specified key, or a default
233 /// constructed value if no such entry exists.
234 ValueTy lookup(StringRef Key) const {
235 const_iterator Iter = find(Key);
236 if (Iter != end())
237 return Iter->second;
238 return ValueTy();
239 }
240
241 /// at - Return the entry for the specified key, or abort if no such
242 /// entry exists.
243 const ValueTy &at(StringRef Val) const {
244 auto Iter = this->find(std::move(Val));
245 assert(Iter != this->end() && "StringMap::at failed due to a missing key");
246 return Iter->second;
247 }
248
249 /// Lookup the ValueTy for the \p Key, or create a default constructed value
250 /// if the key is not in the map.
251 ValueTy &operator[](StringRef Key) { return try_emplace(Key).first->second; }
252
253 /// contains - Return true if the element is in the map, false otherwise.
254 bool contains(StringRef Key) const { return find(Key) != end(); }
255
256 /// count - Return 1 if the element is in the map, 0 otherwise.
257 size_type count(StringRef Key) const { return contains(Key) ? 1 : 0; }
258
259 template <typename InputTy>
260 size_type count(const StringMapEntry<InputTy> &MapEntry) const {
261 return count(MapEntry.getKey());
262 }
263
264 /// equal - check whether both of the containers are equal.
265 bool operator==(const StringMap &RHS) const {
266 if (size() != RHS.size())
267 return false;
268
269 for (const auto &KeyValue : *this) {
270 auto FindInRHS = RHS.find(KeyValue.getKey());
271
272 if (FindInRHS == RHS.end())
273 return false;
274
275 if (!(KeyValue.getValue() == FindInRHS->getValue()))
276 return false;
277 }
278
279 return true;
280 }
281
282 bool operator!=(const StringMap &RHS) const { return !(*this == RHS); }
283
284 /// insert - Insert the specified key/value pair into the map. If the key
285 /// already exists in the map, return false and ignore the request, otherwise
286 /// insert it and return true.
287 bool insert(MapEntryTy *KeyValue) {
288 unsigned BucketNo = LookupBucketFor(KeyValue->getKey());
289 StringMapEntryBase *&Bucket = TheTable[BucketNo];
290 if (Bucket && Bucket != getTombstoneVal())
291 return false; // Already exists in map.
292
293 if (Bucket == getTombstoneVal())
294 --NumTombstones;
295 Bucket = KeyValue;
296 ++NumItems;
297 assert(NumItems + NumTombstones <= NumBuckets);
298
299 RehashTable();
300 return true;
301 }
302
303 /// insert - Inserts the specified key/value pair into the map if the key
304 /// isn't already in the map. The bool component of the returned pair is true
305 /// if and only if the insertion takes place, and the iterator component of
306 /// the pair points to the element with key equivalent to the key of the pair.
307 std::pair<iterator, bool> insert(std::pair<StringRef, ValueTy> KV) {
308 return try_emplace(KV.first, std::move(KV.second));
309 }
310
311 /// Inserts elements from range [first, last). If multiple elements in the
312 /// range have keys that compare equivalent, it is unspecified which element
313 /// is inserted .
314 template <typename InputIt> void insert(InputIt First, InputIt Last) {
315 for (InputIt It = First; It != Last; ++It)
316 insert(*It);
317 }
318
319 /// Inserts elements from initializer list ilist. If multiple elements in
320 /// the range have keys that compare equivalent, it is unspecified which
321 /// element is inserted
322 void insert(std::initializer_list<std::pair<StringRef, ValueTy>> List) {
323 insert(List.begin(), List.end());
324 }
325
326 /// Inserts an element or assigns to the current element if the key already
327 /// exists. The return type is the same as try_emplace.
328 template <typename V>
329 std::pair<iterator, bool> insert_or_assign(StringRef Key, V &&Val) {
330 auto Ret = try_emplace(Key, std::forward<V>(Val));
331 if (!Ret.second)
332 Ret.first->second = std::forward<V>(Val);
333 return Ret;
334 }
335
336 /// Emplace a new element for the specified key into the map if the key isn't
337 /// already in the map. The bool component of the returned pair is true
338 /// if and only if the insertion takes place, and the iterator component of
339 /// the pair points to the element with key equivalent to the key of the pair.
340 template <typename... ArgsTy>
341 std::pair<iterator, bool> try_emplace(StringRef Key, ArgsTy &&...Args) {
342 unsigned BucketNo = LookupBucketFor(Key);
343 StringMapEntryBase *&Bucket = TheTable[BucketNo];
344 if (Bucket && Bucket != getTombstoneVal())
345 return std::make_pair(iterator(TheTable + BucketNo, false),
346 false); // Already exists in map.
347
348 if (Bucket == getTombstoneVal())
349 --NumTombstones;
350 Bucket =
351 MapEntryTy::create(Key, getAllocator(), std::forward<ArgsTy>(Args)...);
352 ++NumItems;
353 assert(NumItems + NumTombstones <= NumBuckets);
354
355 BucketNo = RehashTable(BucketNo);
356 return std::make_pair(iterator(TheTable + BucketNo, false), true);
357 }
358
359 // clear - Empties out the StringMap
360 void clear() {
361 if (empty())
362 return;
363
364 // Zap all values, resetting the keys back to non-present (not tombstone),
365 // which is safe because we're removing all elements.
366 for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
367 StringMapEntryBase *&Bucket = TheTable[I];
368 if (Bucket && Bucket != getTombstoneVal()) {
369 static_cast<MapEntryTy *>(Bucket)->Destroy(getAllocator());
370 }
371 Bucket = nullptr;
372 }
373
374 NumItems = 0;
375 NumTombstones = 0;
376 }
377
378 /// remove - Remove the specified key/value pair from the map, but do not
379 /// erase it. This aborts if the key is not in the map.
380 void remove(MapEntryTy *KeyValue) { RemoveKey(KeyValue); }
381
383 MapEntryTy &V = *I;
384 remove(&V);
385 V.Destroy(getAllocator());
386 }
387
388 bool erase(StringRef Key) {
389 iterator I = find(Key);
390 if (I == end())
391 return false;
392 erase(I);
393 return true;
394 }
395};
396
397template <typename DerivedTy, typename ValueTy>
399 : public iterator_facade_base<DerivedTy, std::forward_iterator_tag,
400 ValueTy> {
401protected:
403
404public:
405 StringMapIterBase() = default;
406
408 bool NoAdvance = false)
409 : Ptr(Bucket) {
410 if (!NoAdvance)
411 AdvancePastEmptyBuckets();
412 }
413
414 DerivedTy &operator=(const DerivedTy &Other) {
415 Ptr = Other.Ptr;
416 return static_cast<DerivedTy &>(*this);
417 }
418
419 friend bool operator==(const DerivedTy &LHS, const DerivedTy &RHS) {
420 return LHS.Ptr == RHS.Ptr;
421 }
422
423 DerivedTy &operator++() { // Preincrement
424 ++Ptr;
425 AdvancePastEmptyBuckets();
426 return static_cast<DerivedTy &>(*this);
427 }
428
429 DerivedTy operator++(int) { // Post-increment
430 DerivedTy Tmp(Ptr);
431 ++*this;
432 return Tmp;
433 }
434
435private:
436 void AdvancePastEmptyBuckets() {
437 while (*Ptr == nullptr || *Ptr == StringMapImpl::getTombstoneVal())
438 ++Ptr;
439 }
440};
441
442template <typename ValueTy>
444 : public StringMapIterBase<StringMapConstIterator<ValueTy>,
445 const StringMapEntry<ValueTy>> {
448
449public:
452 bool NoAdvance = false)
453 : base(Bucket, NoAdvance) {}
454
456 return *static_cast<const StringMapEntry<ValueTy> *>(*this->Ptr);
457 }
458};
459
460template <typename ValueTy>
461class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
462 StringMapEntry<ValueTy>> {
463 using base =
465
466public:
467 StringMapIterator() = default;
469 bool NoAdvance = false)
470 : base(Bucket, NoAdvance) {}
471
473 return *static_cast<StringMapEntry<ValueTy> *>(*this->Ptr);
474 }
475
477 return StringMapConstIterator<ValueTy>(this->Ptr, true);
478 }
479};
480
481template <typename ValueTy>
483 : public iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
484 StringMapConstIterator<ValueTy>,
485 std::forward_iterator_tag, StringRef> {
488 std::forward_iterator_tag, StringRef>;
489
490public:
493 : base(std::move(Iter)) {}
494
495 StringRef operator*() const { return this->wrapped()->getKey(); }
496};
497
498} // end namespace llvm
499
500#endif // LLVM_ADT_STRINGMAP_H
This file defines the StringMapEntry class - it is intended to be a low dependency implementation det...
This file defines MallocAllocator.
#define LLVM_ALLOCATORHOLDER_EMPTYBASE
Definition: AllocatorBase.h:25
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
uint64_t Size
#define I(x, y, z)
Definition: MD5.cpp:58
const NodeList & List
Definition: RDFGraph.cpp:201
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
Definition: Value.cpp:470
Value * RHS
Value * LHS
StringMapConstIterator(StringMapEntryBase **Bucket, bool NoAdvance=false)
Definition: StringMap.h:451
const StringMapEntry< ValueTy > & operator*() const
Definition: StringMap.h:455
StringMapEntryBase - Shared base class of StringMapEntry instances.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef getKey() const
StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations.
Definition: StringMap.h:32
void swap(StringMapImpl &Other)
Definition: StringMap.h:97
static StringMapEntryBase * getTombstoneVal()
Definition: StringMap.h:87
unsigned ItemSize
Definition: StringMap.h:41
int FindKey(StringRef Key) const
FindKey - Look up the bucket that contains the specified key.
Definition: StringMap.cpp:142
unsigned RehashTable(unsigned BucketNo=0)
RehashTable - Grow the table, redistributing values into the buckets with the appropriate mod-of-hash...
Definition: StringMap.cpp:211
unsigned NumItems
Definition: StringMap.h:39
unsigned LookupBucketFor(StringRef Key)
LookupBucketFor - Look up the bucket that the specified string should end up in.
Definition: StringMap.cpp:84
void RemoveKey(StringMapEntryBase *V)
RemoveKey - Remove the specified StringMapEntry from the table, but do not delete it.
Definition: StringMap.cpp:186
StringMapEntryBase ** TheTable
Definition: StringMap.h:37
unsigned getNumBuckets() const
Definition: StringMap.h:91
unsigned size() const
Definition: StringMap.h:95
StringMapImpl(unsigned itemSize)
Definition: StringMap.h:44
void init(unsigned Size)
Allocate the table with the specified number of buckets and otherwise setup the map as empty.
Definition: StringMap.cpp:65
unsigned getNumItems() const
Definition: StringMap.h:92
unsigned NumBuckets
Definition: StringMap.h:38
static constexpr uintptr_t TombstoneIntVal
Definition: StringMap.h:83
unsigned NumTombstones
Definition: StringMap.h:40
bool empty() const
Definition: StringMap.h:94
StringMapImpl(StringMapImpl &&RHS)
Definition: StringMap.h:45
DerivedTy & operator++()
Definition: StringMap.h:423
StringMapEntryBase ** Ptr
Definition: StringMap.h:402
DerivedTy operator++(int)
Definition: StringMap.h:429
DerivedTy & operator=(const DerivedTy &Other)
Definition: StringMap.h:414
StringMapIterBase(StringMapEntryBase **Bucket, bool NoAdvance=false)
Definition: StringMap.h:407
friend bool operator==(const DerivedTy &LHS, const DerivedTy &RHS)
Definition: StringMap.h:419
StringMapIterator(StringMapEntryBase **Bucket, bool NoAdvance=false)
Definition: StringMap.h:468
StringMapEntry< ValueTy > & operator*() const
Definition: StringMap.h:472
StringRef operator*() const
Definition: StringMap.h:495
StringMapKeyIterator(StringMapConstIterator< ValueTy > Iter)
Definition: StringMap.h:492
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:112
size_type count(const StringMapEntry< InputTy > &MapEntry) const
Definition: StringMap.h:260
StringMap(StringMap &&RHS)
Definition: StringMap.h:135
bool erase(StringRef Key)
Definition: StringMap.h:388
iterator end()
Definition: StringMap.h:205
StringMap(std::initializer_list< std::pair< StringRef, ValueTy > > List)
Definition: StringMap.h:130
bool operator!=(const StringMap &RHS) const
Definition: StringMap.h:282
iterator begin()
Definition: StringMap.h:204
void remove(MapEntryTy *KeyValue)
remove - Remove the specified key/value pair from the map, but do not erase it.
Definition: StringMap.h:380
std::pair< iterator, bool > insert_or_assign(StringRef Key, V &&Val)
Inserts an element or assigns to the current element if the key already exists.
Definition: StringMap.h:329
iterator find(StringRef Key)
Definition: StringMap.h:218
const_iterator end() const
Definition: StringMap.h:209
StringMap(const StringMap &RHS)
Definition: StringMap.h:138
const ValueTy & at(StringRef Val) const
at - Return the entry for the specified key, or abort if no such entry exists.
Definition: StringMap.h:243
bool contains(StringRef Key) const
contains - Return true if the element is in the map, false otherwise.
Definition: StringMap.h:254
size_t size_type
Definition: StringMap.h:199
ValueTy mapped_type
Definition: StringMap.h:197
std::pair< iterator, bool > insert(std::pair< StringRef, ValueTy > KV)
insert - Inserts the specified key/value pair into the map if the key isn't already in the map.
Definition: StringMap.h:307
iterator_range< StringMapKeyIterator< ValueTy > > keys() const
Definition: StringMap.h:213
const_iterator find(StringRef Key) const
Definition: StringMap.h:225
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:257
StringMap(AllocatorTy A)
Definition: StringMap.h:123
StringMap & operator=(StringMap RHS)
Definition: StringMap.h:173
void insert(InputIt First, InputIt Last)
Inserts elements from range [first, last).
Definition: StringMap.h:314
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: StringMap.h:234
const_iterator begin() const
Definition: StringMap.h:206
void erase(iterator I)
Definition: StringMap.h:382
StringMap(unsigned InitialSize)
Definition: StringMap.h:120
std::pair< iterator, bool > try_emplace(StringRef Key, ArgsTy &&...Args)
Emplace a new element for the specified key into the map if the key isn't already in the map.
Definition: StringMap.h:341
StringMap(unsigned InitialSize, AllocatorTy A)
Definition: StringMap.h:126
ValueTy & operator[](StringRef Key)
Lookup the ValueTy for the Key, or create a default constructed value if the key is not in the map.
Definition: StringMap.h:251
bool operator==(const StringMap &RHS) const
equal - check whether both of the containers are equal.
Definition: StringMap.h:265
void insert(std::initializer_list< std::pair< StringRef, ValueTy > > List)
Inserts elements from initializer list ilist.
Definition: StringMap.h:322
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:287
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
CRTP base class for adapting an iterator to a different type.
Definition: iterator.h:237
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:80
A range adaptor for a pair of iterators.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1747
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition: STLExtras.h:1685
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
@ Other
Any other memory.
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
Definition: STLExtras.h:1919
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1854
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:860
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...