[llvm] [ADT] Add SmallVectorImpl::append_range (PR #93384)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Sat May 25 15:05:53 PDT 2024


kuhar wrote:

> > Don't we already have (the more generic) `append_range(V, R)` for this purpose?
> 
> Yes, the aim is to convert those calls to `llvm::append_range` on `llvm::SmallVector` to `llvm::SmallVector::append_range`. Once we switch to C++23 in a few years, we can convert those calls to `llvm::append_range` on `std::vector` to `std::vector::append_range` also.

Is your argument to keep the small vector API as close to `std::vector`? I assume we won't be switching to `std::vector` due to performance reasons. Is the idea to just make it more familiar to new llvm developers?

Separately, can we make the implementation more performant by making `append_range` a member function? I don't think this is the case based on the current implementation.

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


More information about the llvm-commits mailing list