[PATCH] D77621: ADT: SmallVector size/capacity use word-size integers when elements are small

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 20:35:33 PDT 2020


dexonsmith added a comment.

In D77621#2002430 <https://reviews.llvm.org/D77621#2002430>, @dblaikie wrote:

> (seems a bit questionable to rely on uintptr_t being necessarily the same type as either uint32_t or uint64_t - but maybe that's guaranteed/written down somewhere)?


I think in practice uintptr_t will match range and size with one of uint32_t and uint64_t, but as you suggest it might not be equivalent to either (e.g., could use all three of unsigned, unsigned long, and unsigned long long).  We need to be consistent between the std::conditional in SmallVectorSizeType and the explicit instantiations (and skimming the current implementation it looks like it is consistent, doesn’t rely on uintptr_t).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77621





More information about the cfe-commits mailing list