- Extract createTable and getHashTable functions.
- Add the inline attribute to the getMinBucketToReserveForEntries function.
- Remove unnecessary local variable HTSize.
Statements in the following order appear in llvm::StringMapImpl::init and llvm::StringMapImpl::RehashTable, so I extracted this code into a function. getHashTable is for the same reason, it appears in llvm::StringMapImpl::FindKey, llvm::StringMapImpl::LookupBucketFor and llvm::StringMapImpl::RehashTable.
auto **Table = static_cast<StringMapEntryBase **>(safe_calloc( NewNumBuckets + 1, sizeof(StringMapEntryBase **) + sizeof(unsigned))); // Allocate one extra bucket, set it to look filled so the iterators stop at // end. Table[NewNumBuckets] = (StringMapEntryBase *)2;
unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
This change is not reflected in the commit message...