Added member function "size()" to FoldingSet to return the number of
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Oct 2007 23:35:55 +0000 (23:35 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Oct 2007 23:35:55 +0000 (23:35 +0000)
nodes in the FoldingSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43531 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/FoldingSet.h

index c567895594b5663f19a1c0d6794fdce5f308877f..2e74f2c8c15e03578e7d41b2bc8528b0649eb555 100644 (file)
@@ -202,7 +202,10 @@ public:
   /// it is not already in the folding set.  InsertPos must be obtained from 
   /// FindNodeOrInsertPos.
   void InsertNode(Node *N, void *InsertPos);
-    
+  
+  /// size - Returns the number of nodes in the folding set.
+  unsigned size() const { return NumNodes; }
+  
 private:
 
   /// GrowHashTable - Double the size of the hash table and rehash everything.