[PATCH] D81342: [Support] FoldingSetNodeID::AddString(): reserve memory

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 7 09:34:33 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Support/FoldingSet.cpp:90
+
+  unsigned NumInserts = 1 + ((Size + 4 - 1) / 4); // 1 + ┌Size / 4┐
+  Bits.reserve(Bits.size() + NumInserts);
----------------
bkramer wrote:
> We have `divideCeil` in MathExtras.
Ah, that is how it's called here. Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81342





More information about the llvm-commits mailing list