[all-commits] [llvm/llvm-project] 475dd6: [SmallVector] Add an explicit SmallVector(size_t S...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Apr 3 13:23:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 475dd6f626ee2679578ed570e9fb78f7e957a36d
      https://github.com/llvm/llvm-project/commit/475dd6f626ee2679578ed570e9fb78f7e957a36d
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-04-03 (Mon, 03 Apr 2023)

  Changed paths:
    M llvm/include/llvm/ADT/SmallVector.h
    M llvm/unittests/ADT/SmallVectorTest.cpp

  Log Message:
  -----------
  [SmallVector] Add an explicit SmallVector(size_t Size) constructor.

Previously we used the SmallVector(size_t Size, const T& Value) constructor
with a default constructed Value. That will copy construct every element
in the vector, but not all types can be copy constructed.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D147426




More information about the All-commits mailing list