[llvm] [ADT] Always use 32-bit size type for SmallVector with 16-bit elements (PR #95536)

Daniel Bertalan via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 14:28:27 PDT 2024


BertalanD wrote:

In `SmallVectorSizeType`'s definition, **`size_t`** or `uint32_t` is used:

https://github.com/llvm/llvm-project/blob/2582d11f1a8a5783828156d3ced354727f422885/llvm/include/llvm/ADT/SmallVector.h#L117-L119

But the `grow_pod` function is instantiated for **`uint64_t`** or `uint32_t`:

https://github.com/llvm/llvm-project/blob/2582d11f1a8a5783828156d3ced354727f422885/llvm/lib/Support/SmallVector.cpp#L163-L170

On the arm64 Apple ABI, `size_t` == `unsigned long` and `uint64_t` == `unsigned long long`.

https://github.com/llvm/llvm-project/pull/95536


More information about the llvm-commits mailing list