[SmallVector] Add an explicit SmallVector(size_t Size) constructor.
authorCraig Topper <craig.topper@sifive.com>
Mon, 3 Apr 2023 20:22:36 +0000 (13:22 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 3 Apr 2023 20:22:36 +0000 (13:22 -0700)
commit475dd6f626ee2679578ed570e9fb78f7e957a36d
tree20629a79b547640708ae86300a30a92bcf0f39dc
parent8c3ae74ab147cad84f6bebc6d30a6e5a309f0d9f
[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
llvm/include/llvm/ADT/SmallVector.h
llvm/unittests/ADT/SmallVectorTest.cpp