aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-11-02 14:21:26 +0000
committerJim Laskey <jlaskey@mac.com>2006-11-02 14:21:26 +0000
commit1f67a99260917d33fefc6a7d863b0cd850a34431 (patch)
treedcfdb17cbc44a94c86d16edb45b122a5a33599d1 /lib/Support
parent41562398b6524760762a1d522c090710db6b4928 (diff)
downloadexternal_llvm-1f67a99260917d33fefc6a7d863b0cd850a34431.zip
external_llvm-1f67a99260917d33fefc6a7d863b0cd850a34431.tar.gz
external_llvm-1f67a99260917d33fefc6a7d863b0cd850a34431.tar.bz2
Allow FoldingSet clients to pump up the initial hash size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/FoldingSet.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp
index 1bd2014..a569e1a 100644
--- a/lib/Support/FoldingSet.cpp
+++ b/lib/Support/FoldingSet.cpp
@@ -151,8 +151,10 @@ static void **GetBucketFor(const FoldingSetImpl::NodeID &ID,
//===----------------------------------------------------------------------===//
// FoldingSetImpl Implementation
-FoldingSetImpl::FoldingSetImpl() : NumNodes(0) {
- NumBuckets = 64;
+FoldingSetImpl::FoldingSetImpl(unsigned Log2InitSize) : NumNodes(0) {
+ assert(5 < Log2InitSize && Log2InitSize < 32 &&
+ "Initial hash table size out of range");
+ NumBuckets = 1 << Log2InitSize;
Buckets = new void*[NumBuckets];
memset(Buckets, 0, NumBuckets*sizeof(void*));
}