summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/FoldingSet.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-30 23:35:55 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-30 23:35:55 +0000
commit20b7907c1cb7074a2e6be5f534bb742752dd25d4 (patch)
treeeaa4198e1cdb610ad1d8b4e7c2aacf60dab1ceb6 /include/llvm/ADT/FoldingSet.h
parente45bb9ad5e7467bc6ba39f2963aa58734aaba98c (diff)
downloadllvm-20b7907c1cb7074a2e6be5f534bb742752dd25d4.tar.gz
llvm-20b7907c1cb7074a2e6be5f534bb742752dd25d4.tar.bz2
llvm-20b7907c1cb7074a2e6be5f534bb742752dd25d4.tar.xz
Added member function "size()" to FoldingSet to return the number of
nodes in the FoldingSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/FoldingSet.h')
-rw-r--r--include/llvm/ADT/FoldingSet.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h
index c567895594..2e74f2c8c1 100644
--- a/include/llvm/ADT/FoldingSet.h
+++ b/include/llvm/ADT/FoldingSet.h
@@ -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.