LLVM  4.0.0
FoldingSet.cpp
Go to the documentation of this file.
1 //===-- Support/FoldingSet.cpp - Uniquing Hash Set --------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements a hash set that can be used to remove duplication of
11 // nodes in a graph.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "llvm/ADT/FoldingSet.h"
16 #include "llvm/ADT/Hashing.h"
17 #include "llvm/Support/Allocator.h"
19 #include "llvm/Support/Host.h"
21 #include <cassert>
22 #include <cstring>
23 using namespace llvm;
24 
25 //===----------------------------------------------------------------------===//
26 // FoldingSetNodeIDRef Implementation
27 
28 /// ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef,
29 /// used to lookup the node in the FoldingSetImpl.
31  return static_cast<unsigned>(hash_combine_range(Data, Data+Size));
32 }
33 
35  if (Size != RHS.Size) return false;
36  return memcmp(Data, RHS.Data, Size*sizeof(*Data)) == 0;
37 }
38 
39 /// Used to compare the "ordering" of two nodes as defined by the
40 /// profiled bits and their ordering defined by memcmp().
42  if (Size != RHS.Size)
43  return Size < RHS.Size;
44  return memcmp(Data, RHS.Data, Size*sizeof(*Data)) < 0;
45 }
46 
47 //===----------------------------------------------------------------------===//
48 // FoldingSetNodeID Implementation
49 
50 /// Add* - Add various data types to Bit data.
51 ///
52 void FoldingSetNodeID::AddPointer(const void *Ptr) {
53  // Note: this adds pointers to the hash using sizes and endianness that
54  // depend on the host. It doesn't matter, however, because hashing on
55  // pointer values is inherently unstable. Nothing should depend on the
56  // ordering of nodes in the folding set.
57  static_assert(sizeof(uintptr_t) <= sizeof(unsigned long long),
58  "unexpected pointer size");
59  AddInteger(reinterpret_cast<uintptr_t>(Ptr));
60 }
62  Bits.push_back(I);
63 }
65  Bits.push_back(I);
66 }
68  AddInteger((unsigned long)I);
69 }
70 void FoldingSetNodeID::AddInteger(unsigned long I) {
71  if (sizeof(long) == sizeof(int))
72  AddInteger(unsigned(I));
73  else if (sizeof(long) == sizeof(long long)) {
74  AddInteger((unsigned long long)I);
75  } else {
76  llvm_unreachable("unexpected sizeof(long)");
77  }
78 }
80  AddInteger((unsigned long long)I);
81 }
82 void FoldingSetNodeID::AddInteger(unsigned long long I) {
83  AddInteger(unsigned(I));
84  AddInteger(unsigned(I >> 32));
85 }
86 
88  unsigned Size = String.size();
89  Bits.push_back(Size);
90  if (!Size) return;
91 
92  unsigned Units = Size / 4;
93  unsigned Pos = 0;
94  const unsigned *Base = (const unsigned*) String.data();
95 
96  // If the string is aligned do a bulk transfer.
97  if (!((intptr_t)Base & 3)) {
98  Bits.append(Base, Base + Units);
99  Pos = (Units + 1) * 4;
100  } else {
101  // Otherwise do it the hard way.
102  // To be compatible with above bulk transfer, we need to take endianness
103  // into account.
105  "Unexpected host endianness");
106  if (sys::IsBigEndianHost) {
107  for (Pos += 4; Pos <= Size; Pos += 4) {
108  unsigned V = ((unsigned char)String[Pos - 4] << 24) |
109  ((unsigned char)String[Pos - 3] << 16) |
110  ((unsigned char)String[Pos - 2] << 8) |
111  (unsigned char)String[Pos - 1];
112  Bits.push_back(V);
113  }
114  } else { // Little-endian host
115  for (Pos += 4; Pos <= Size; Pos += 4) {
116  unsigned V = ((unsigned char)String[Pos - 1] << 24) |
117  ((unsigned char)String[Pos - 2] << 16) |
118  ((unsigned char)String[Pos - 3] << 8) |
119  (unsigned char)String[Pos - 4];
120  Bits.push_back(V);
121  }
122  }
123  }
124 
125  // With the leftover bits.
126  unsigned V = 0;
127  // Pos will have overshot size by 4 - #bytes left over.
128  // No need to take endianness into account here - this is always executed.
129  switch (Pos - Size) {
130  case 1: V = (V << 8) | (unsigned char)String[Size - 3]; LLVM_FALLTHROUGH;
131  case 2: V = (V << 8) | (unsigned char)String[Size - 2]; LLVM_FALLTHROUGH;
132  case 3: V = (V << 8) | (unsigned char)String[Size - 1]; break;
133  default: return; // Nothing left.
134  }
135 
136  Bits.push_back(V);
137 }
138 
139 // AddNodeID - Adds the Bit data of another ID to *this.
141  Bits.append(ID.Bits.begin(), ID.Bits.end());
142 }
143 
144 /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to
145 /// lookup the node in the FoldingSetImpl.
147  return FoldingSetNodeIDRef(Bits.data(), Bits.size()).ComputeHash();
148 }
149 
150 /// operator== - Used to compare two nodes to each other.
151 ///
153  return *this == FoldingSetNodeIDRef(RHS.Bits.data(), RHS.Bits.size());
154 }
155 
156 /// operator== - Used to compare two nodes to each other.
157 ///
159  return FoldingSetNodeIDRef(Bits.data(), Bits.size()) == RHS;
160 }
161 
162 /// Used to compare the "ordering" of two nodes as defined by the
163 /// profiled bits and their ordering defined by memcmp().
165  return *this < FoldingSetNodeIDRef(RHS.Bits.data(), RHS.Bits.size());
166 }
167 
169  return FoldingSetNodeIDRef(Bits.data(), Bits.size()) < RHS;
170 }
171 
172 /// Intern - Copy this node's data to a memory region allocated from the
173 /// given allocator and return a FoldingSetNodeIDRef describing the
174 /// interned data.
177  unsigned *New = Allocator.Allocate<unsigned>(Bits.size());
178  std::uninitialized_copy(Bits.begin(), Bits.end(), New);
179  return FoldingSetNodeIDRef(New, Bits.size());
180 }
181 
182 //===----------------------------------------------------------------------===//
183 /// Helper functions for FoldingSetImpl.
184 
185 /// GetNextPtr - In order to save space, each bucket is a
186 /// singly-linked-list. In order to make deletion more efficient, we make
187 /// the list circular, so we can delete a node without computing its hash.
188 /// The problem with this is that the start of the hash buckets are not
189 /// Nodes. If NextInBucketPtr is a bucket pointer, this method returns null:
190 /// use GetBucketPtr when this happens.
191 static FoldingSetImpl::Node *GetNextPtr(void *NextInBucketPtr) {
192  // The low bit is set if this is the pointer back to the bucket.
193  if (reinterpret_cast<intptr_t>(NextInBucketPtr) & 1)
194  return nullptr;
195 
196  return static_cast<FoldingSetImpl::Node*>(NextInBucketPtr);
197 }
198 
199 
200 /// testing.
201 static void **GetBucketPtr(void *NextInBucketPtr) {
202  intptr_t Ptr = reinterpret_cast<intptr_t>(NextInBucketPtr);
203  assert((Ptr & 1) && "Not a bucket pointer");
204  return reinterpret_cast<void**>(Ptr & ~intptr_t(1));
205 }
206 
207 /// GetBucketFor - Hash the specified node ID and return the hash bucket for
208 /// the specified ID.
209 static void **GetBucketFor(unsigned Hash, void **Buckets, unsigned NumBuckets) {
210  // NumBuckets is always a power of 2.
211  unsigned BucketNum = Hash & (NumBuckets-1);
212  return Buckets + BucketNum;
213 }
214 
215 /// AllocateBuckets - Allocated initialized bucket memory.
216 static void **AllocateBuckets(unsigned NumBuckets) {
217  void **Buckets = static_cast<void**>(calloc(NumBuckets+1, sizeof(void*)));
218  // Set the very last bucket to be a non-null "pointer".
219  Buckets[NumBuckets] = reinterpret_cast<void*>(-1);
220  return Buckets;
221 }
222 
223 //===----------------------------------------------------------------------===//
224 // FoldingSetImpl Implementation
225 
226 void FoldingSetImpl::anchor() {}
227 
228 FoldingSetImpl::FoldingSetImpl(unsigned Log2InitSize) {
229  assert(5 < Log2InitSize && Log2InitSize < 32 &&
230  "Initial hash table size out of range");
231  NumBuckets = 1 << Log2InitSize;
233  NumNodes = 0;
234 }
235 
237  : Buckets(Arg.Buckets), NumBuckets(Arg.NumBuckets), NumNodes(Arg.NumNodes) {
238  Arg.Buckets = nullptr;
239  Arg.NumBuckets = 0;
240  Arg.NumNodes = 0;
241 }
242 
244  free(Buckets); // This may be null if the set is in a moved-from state.
245  Buckets = RHS.Buckets;
246  NumBuckets = RHS.NumBuckets;
247  NumNodes = RHS.NumNodes;
248  RHS.Buckets = nullptr;
249  RHS.NumBuckets = 0;
250  RHS.NumNodes = 0;
251  return *this;
252 }
253 
255  free(Buckets);
256 }
257 
259  // Set all but the last bucket to null pointers.
260  memset(Buckets, 0, NumBuckets*sizeof(void*));
261 
262  // Set the very last bucket to be a non-null "pointer".
263  Buckets[NumBuckets] = reinterpret_cast<void*>(-1);
264 
265  // Reset the node count to zero.
266  NumNodes = 0;
267 }
268 
269 void FoldingSetImpl::GrowBucketCount(unsigned NewBucketCount) {
270  assert((NewBucketCount > NumBuckets) && "Can't shrink a folding set with GrowBucketCount");
271  assert(isPowerOf2_32(NewBucketCount) && "Bad bucket count!");
272  void **OldBuckets = Buckets;
273  unsigned OldNumBuckets = NumBuckets;
274  NumBuckets = NewBucketCount;
275 
276  // Clear out new buckets.
278  NumNodes = 0;
279 
280  // Walk the old buckets, rehashing nodes into their new place.
281  FoldingSetNodeID TempID;
282  for (unsigned i = 0; i != OldNumBuckets; ++i) {
283  void *Probe = OldBuckets[i];
284  if (!Probe) continue;
285  while (Node *NodeInBucket = GetNextPtr(Probe)) {
286  // Figure out the next link, remove NodeInBucket from the old link.
287  Probe = NodeInBucket->getNextInBucket();
288  NodeInBucket->SetNextInBucket(nullptr);
289 
290  // Insert the node into the new bucket, after recomputing the hash.
291  InsertNode(NodeInBucket,
292  GetBucketFor(ComputeNodeHash(NodeInBucket, TempID),
293  Buckets, NumBuckets));
294  TempID.clear();
295  }
296  }
297 
298  free(OldBuckets);
299 }
300 
301 /// GrowHashTable - Double the size of the hash table and rehash everything.
302 ///
303 void FoldingSetImpl::GrowHashTable() {
304  GrowBucketCount(NumBuckets * 2);
305 }
306 
307 void FoldingSetImpl::reserve(unsigned EltCount) {
308  // This will give us somewhere between EltCount / 2 and
309  // EltCount buckets. This puts us in the load factor
310  // range of 1.0 - 2.0.
311  if(EltCount < capacity())
312  return;
313  GrowBucketCount(PowerOf2Floor(EltCount));
314 }
315 
316 /// FindNodeOrInsertPos - Look up the node specified by ID. If it exists,
317 /// return it. If not, return the insertion token that will make insertion
318 /// faster.
321  void *&InsertPos) {
322  unsigned IDHash = ID.ComputeHash();
323  void **Bucket = GetBucketFor(IDHash, Buckets, NumBuckets);
324  void *Probe = *Bucket;
325 
326  InsertPos = nullptr;
327 
328  FoldingSetNodeID TempID;
329  while (Node *NodeInBucket = GetNextPtr(Probe)) {
330  if (NodeEquals(NodeInBucket, ID, IDHash, TempID))
331  return NodeInBucket;
332  TempID.clear();
333 
334  Probe = NodeInBucket->getNextInBucket();
335  }
336 
337  // Didn't find the node, return null with the bucket as the InsertPos.
338  InsertPos = Bucket;
339  return nullptr;
340 }
341 
342 /// InsertNode - Insert the specified node into the folding set, knowing that it
343 /// is not already in the map. InsertPos must be obtained from
344 /// FindNodeOrInsertPos.
345 void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) {
346  assert(!N->getNextInBucket());
347  // Do we need to grow the hashtable?
348  if (NumNodes+1 > capacity()) {
349  GrowHashTable();
350  FoldingSetNodeID TempID;
351  InsertPos = GetBucketFor(ComputeNodeHash(N, TempID), Buckets, NumBuckets);
352  }
353 
354  ++NumNodes;
355 
356  /// The insert position is actually a bucket pointer.
357  void **Bucket = static_cast<void**>(InsertPos);
358 
359  void *Next = *Bucket;
360 
361  // If this is the first insertion into this bucket, its next pointer will be
362  // null. Pretend as if it pointed to itself, setting the low bit to indicate
363  // that it is a pointer to the bucket.
364  if (!Next)
365  Next = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(Bucket)|1);
366 
367  // Set the node's next pointer, and make the bucket point to the node.
368  N->SetNextInBucket(Next);
369  *Bucket = N;
370 }
371 
372 /// RemoveNode - Remove a node from the folding set, returning true if one was
373 /// removed or false if the node was not in the folding set.
375  // Because each bucket is a circular list, we don't need to compute N's hash
376  // to remove it.
377  void *Ptr = N->getNextInBucket();
378  if (!Ptr) return false; // Not in folding set.
379 
380  --NumNodes;
381  N->SetNextInBucket(nullptr);
382 
383  // Remember what N originally pointed to, either a bucket or another node.
384  void *NodeNextPtr = Ptr;
385 
386  // Chase around the list until we find the node (or bucket) which points to N.
387  while (true) {
388  if (Node *NodeInBucket = GetNextPtr(Ptr)) {
389  // Advance pointer.
390  Ptr = NodeInBucket->getNextInBucket();
391 
392  // We found a node that points to N, change it to point to N's next node,
393  // removing N from the list.
394  if (Ptr == N) {
395  NodeInBucket->SetNextInBucket(NodeNextPtr);
396  return true;
397  }
398  } else {
399  void **Bucket = GetBucketPtr(Ptr);
400  Ptr = *Bucket;
401 
402  // If we found that the bucket points to N, update the bucket to point to
403  // whatever is next.
404  if (Ptr == N) {
405  *Bucket = NodeNextPtr;
406  return true;
407  }
408  }
409  }
410 }
411 
412 /// GetOrInsertNode - If there is an existing simple Node exactly
413 /// equal to the specified node, return it. Otherwise, insert 'N' and it
414 /// instead.
417  GetNodeProfile(N, ID);
418  void *IP;
419  if (Node *E = FindNodeOrInsertPos(ID, IP))
420  return E;
421  InsertNode(N, IP);
422  return N;
423 }
424 
425 //===----------------------------------------------------------------------===//
426 // FoldingSetIteratorImpl Implementation
427 
429  // Skip to the first non-null non-self-cycle bucket.
430  while (*Bucket != reinterpret_cast<void*>(-1) &&
431  (!*Bucket || !GetNextPtr(*Bucket)))
432  ++Bucket;
433 
434  NodePtr = static_cast<FoldingSetNode*>(*Bucket);
435 }
436 
438  // If there is another link within this bucket, go to it.
439  void *Probe = NodePtr->getNextInBucket();
440 
441  if (FoldingSetNode *NextNodeInBucket = GetNextPtr(Probe))
442  NodePtr = NextNodeInBucket;
443  else {
444  // Otherwise, this is the last link in this bucket.
445  void **Bucket = GetBucketPtr(Probe);
446 
447  // Skip to the next non-null non-self-cycle bucket.
448  do {
449  ++Bucket;
450  } while (*Bucket != reinterpret_cast<void*>(-1) &&
451  (!*Bucket || !GetNextPtr(*Bucket)));
452 
453  NodePtr = static_cast<FoldingSetNode*>(*Bucket);
454  }
455 }
456 
457 //===----------------------------------------------------------------------===//
458 // FoldingSetBucketIteratorImpl Implementation
459 
461  Ptr = (!*Bucket || !GetNextPtr(*Bucket)) ? (void*) Bucket : *Bucket;
462 }
Node * GetOrInsertNode(Node *N)
GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node...
Definition: FoldingSet.cpp:415
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
Definition: FoldingSet.cpp:52
void push_back(const T &Elt)
Definition: SmallVector.h:211
static void ** AllocateBuckets(unsigned NumBuckets)
AllocateBuckets - Allocated initialized bucket memory.
Definition: FoldingSet.cpp:216
size_t i
void ** Buckets
Buckets - Array of bucket chains.
Definition: FoldingSet.h:119
void InsertNode(Node *N, void *InsertPos)
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the fo...
Definition: FoldingSet.cpp:345
FoldingSetImpl & operator=(FoldingSetImpl &&RHS)
Definition: FoldingSet.cpp:243
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
static void ** GetBucketPtr(void *NextInBucketPtr)
testing.
Definition: FoldingSet.cpp:201
unsigned ComputeHash() const
ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef, used to lookup the node in th...
Definition: FoldingSet.cpp:30
virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const =0
GetNodeProfile - Instantiations of the FoldingSet template implement this function to gather data bit...
void AddInteger(signed I)
Definition: FoldingSet.cpp:61
static const bool IsLittleEndianHost
Definition: Host.h:40
bool operator==(const FoldingSetNodeID &RHS) const
operator== - Used to compare two nodes to each other.
Definition: FoldingSet.cpp:152
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Definition: StringRef.h:135
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:316
virtual unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const =0
ComputeNodeHash - Instantiations of the FoldingSet template implement this function to compute a hash...
void AddNodeID(const FoldingSetNodeID &ID)
Definition: FoldingSet.cpp:140
constexpr bool isPowerOf2_32(uint32_t Value)
isPowerOf2_32 - This function returns true if the argument is a power of two > 0. ...
Definition: MathExtras.h:399
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
void * getNextInBucket() const
Definition: FoldingSet.h:148
FoldingSetNode * NodePtr
Definition: FoldingSet.h:635
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Definition: SmallVector.h:115
bool operator<(FoldingSetNodeIDRef) const
Used to compare the "ordering" of two nodes as defined by the profiled bits and their ordering define...
Definition: FoldingSet.cpp:41
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
Definition: Allocator.h:212
static FoldingSetImpl::Node * GetNextPtr(void *NextInBucketPtr)
Helper functions for FoldingSetImpl.
Definition: FoldingSet.cpp:191
Greedy Register Allocator
Node * FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos)
FindNodeOrInsertPos - Look up the node specified by ID.
Definition: FoldingSet.cpp:320
FoldingSetImpl - Implements the folding set functionality.
Definition: FoldingSet.h:113
static void ** GetBucketFor(unsigned Hash, void **Buckets, unsigned NumBuckets)
GetBucketFor - Hash the specified node ID and return the hash bucket for the specified ID...
Definition: FoldingSet.cpp:209
unsigned NumNodes
NumNodes - Number of nodes in the folding set.
Definition: FoldingSet.h:127
FoldingSetImpl(unsigned Log2InitSize=6)
Definition: FoldingSet.cpp:228
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:392
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool RemoveNode(Node *N)
RemoveNode - Remove a node from the folding set, returning true if one was removed or false if the no...
Definition: FoldingSet.cpp:374
bool operator<(const FoldingSetNodeID &RHS) const
Used to compare the "ordering" of two nodes as defined by the profiled bits and their ordering define...
Definition: FoldingSet.cpp:164
void SetNextInBucket(void *N)
Definition: FoldingSet.h:149
void clear()
clear - Clear the accumulated profile, allowing this FoldingSetNodeID object to be used to compute a ...
Definition: FoldingSet.h:345
unsigned capacity()
capacity - Returns the number of nodes permitted in the folding set before a rebucket operation is pe...
Definition: FoldingSet.h:195
Node - This class is used to maintain the singly linked bucket list in a folding set.
Definition: FoldingSet.h:139
unsigned NumBuckets
NumBuckets - Length of the Buckets array.
Definition: FoldingSet.h:123
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
Definition: Hashing.h:480
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:119
FoldingSetNodeIDRef - This class describes a reference to an interned FoldingSetNodeID, which can be a useful to store node id data rather than using plain FoldingSetNodeIDs, since the 32-element SmallVector is often much larger than necessary, and the possibility of heap allocation means it requires a non-trivial destructor call.
Definition: FoldingSet.h:287
pointer data()
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:142
FoldingSetIteratorImpl(void **Bucket)
Definition: FoldingSet.cpp:428
unsigned ComputeHash() const
ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to lookup the node in the F...
Definition: FoldingSet.cpp:146
static const bool IsBigEndianHost
Definition: Host.h:37
#define I(x, y, z)
Definition: MD5.cpp:54
#define N
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:135
void AddString(StringRef String)
Definition: FoldingSet.cpp:87
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
FoldingSetBucketIteratorImpl(void **Bucket)
Definition: FoldingSet.cpp:460
uint64_t PowerOf2Floor(uint64_t A)
Returns the power of two which is less than or equal to the given value.
Definition: MathExtras.h:631
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:239
void reserve(unsigned EltCount)
reserve - Increase the number of buckets such that adding the EltCount-th node won't cause a rebucket...
Definition: FoldingSet.cpp:307
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:125
FoldingSetNodeIDRef Intern(BumpPtrAllocator &Allocator) const
Intern - Copy this node's data to a memory region allocated from the given allocator and return a Fol...
Definition: FoldingSet.cpp:176
std::string Hash(const Unit &U)
Definition: FuzzerSHA1.cpp:216
virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash, FoldingSetNodeID &TempID) const =0
NodeEquals - Instantiations of the FoldingSet template implement this function to compare the given n...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
int * Ptr
void clear()
clear - Remove all nodes from the folding set.
Definition: FoldingSet.cpp:258
bool operator==(FoldingSetNodeIDRef) const
Definition: FoldingSet.cpp:34