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

Andrew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 13:26:59 PDT 2020


browneee added a comment.

In D77621#2013546 <https://reviews.llvm.org/D77621#2013546>, @nikic wrote:

> @browneee Looks like LLVM already defines `LLVM_PTR_SIZE` as a more portable version of `__SIZEOF_POINTER__`.


I saw LLVM_PTR_SIZE, but its definition may be based on sizeof() <https://github.com/llvm/llvm-project/blob/2c046c422f8bc5a879c413eba1629e3753939ac5/llvm/include/llvm/Support/Compiler.h#L424>, so I don't think it should be used in a preprocessor condition.

SIZE_MAX looks like a good option.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77621





More information about the llvm-commits mailing list