[all-commits] [llvm/llvm-project] 5fb39e: [LLVM][ADT] Explicitly convert size_t values to Sm...

Andrei Golubev via All-commits all-commits at lists.llvm.org
Mon Jan 22 00:39:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fb39efe680642c6cab072560efa3bfce6646fb0
      https://github.com/llvm/llvm-project/commit/5fb39efe680642c6cab072560efa3bfce6646fb0
  Author: Andrei Golubev <andrey.golubev at intel.com>
  Date:   2024-01-22 (Mon, 22 Jan 2024)

  Changed paths:
    M llvm/include/llvm/ADT/SmallVector.h
    M llvm/lib/Support/SmallVector.cpp

  Log Message:
  -----------
  [LLVM][ADT] Explicitly convert size_t values to SmallVector's size type (#77939)

Multiple places rely on implicit conversion when assigning 'size_t'
values to the member fields (size or capacity) of SmallVector.

Depending on the platform / compiler configuration, this may result in
narrowing conversion warnings (especially given that the size type of
SmallVector's member fields is determined based on type T - in
SmallVector<T>). To avoid the problem altogether, make the conversions
explicit.

Co-authored-by: Orest Chura <orest.chura at intel.com>




More information about the All-commits mailing list