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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat May 25 15:09:03 PDT 2024


kazutakahirata 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`?

Yes.

> I assume we won't be switching to `std::vector` due to performance reasons.

Right.

> Is the idea to just make it more familiar to new llvm developers?

Yes.

> 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.

Are you referring to `llvm::append_range`?  `llvm::SmallVector::append_range` proposed here is already a member function.

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


More information about the llvm-commits mailing list