[NFC] Add size inference to to_vector
authorGeoffrey Martin-Noble <gcmn@google.com>
Mon, 1 Nov 2021 23:41:44 +0000 (16:41 -0700)
committerGeoffrey Martin-Noble <gcmn@google.com>
Thu, 4 Nov 2021 16:24:02 +0000 (09:24 -0700)
commitc92de29f8d39729678dfe2c915035e453dd83142
tree614591332da6789007ad1903482aaea63ca9333e
parent26ec5da744b80b14bc91707ec56e8da58167ea19
[NFC] Add size inference to to_vector

A default calculated size for SmallVector was added in
https://reviews.llvm.org/D92522 after discussion in
https://groups.google.com/g/llvm-dev/c/Z-VwNCTRGSg, but to_vector still
requires an explicit size. This patch adds the default size to to_vector
as well, so that this case doesn't unnecessarily force users to pick an
arbitrary size.

Reviewed By: silvas, dblaikie

Differential Revision: https://reviews.llvm.org/D112968
llvm/include/llvm/ADT/SmallVector.h
llvm/unittests/ADT/STLExtrasTest.cpp