[PATCH] D121934: [NFC][llvm][StringMap]Extract createTable and getHashTable functions and add the inline attribute to the getMinBucketToReserveForEntries function.

Wang Yihan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 23:38:21 PDT 2022


yihanaa added a reviewer: pengfei.
yihanaa marked 4 inline comments as done.
yihanaa added inline comments.


================
Comment at: llvm/lib/Support/StringMap.cpp:57-65
-  TheTable = static_cast<StringMapEntryBase **>(safe_calloc(
-      NewNumBuckets + 1, sizeof(StringMapEntryBase **) + sizeof(unsigned)));
+  TheTable = createTable(NewNumBuckets);
 
   // Set the member only if TheTable was successfully allocated
   NumBuckets = NewNumBuckets;
-
-  // Allocate one extra bucket, set it to look filled so the iterators stop at
----------------
skan wrote:
> I am not an expert here, Is it always safe to change the order of the three statements?
I have updated the summary.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121934/new/

https://reviews.llvm.org/D121934



More information about the llvm-commits mailing list