[clang] [llvm] [llvm][clang] Remove `llvm::OwningArrayRef` (PR #169126)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 22 13:44:34 PST 2025
================
@@ -246,17 +246,17 @@ class VTableLayout {
// point for a given vtable index.
typedef llvm::SmallVector<unsigned, 4> AddressPointsIndexMapTy;
+ using VTableIndicesTy = llvm::SmallVector<std::size_t>;
+
private:
- // Stores the component indices of the first component of each virtual table in
- // the virtual table group. To save a little memory in the common case where
- // the vtable group contains a single vtable, an empty vector here represents
- // the vector {0}.
- OwningArrayRef<size_t> VTableIndices;
+ // Stores the component indices of the first component of each virtual table
+ // in the virtual table group.
+ VTableIndicesTy VTableIndices;
- OwningArrayRef<VTableComponent> VTableComponents;
+ std::vector<VTableComponent> VTableComponents;
----------------
kuhar wrote:
Our programmers manual recommends SmallVector over std::vector. We could use `SmallVector<T, 0>` if having a small buffer on the stack doesn't make sense.
https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h
https://github.com/llvm/llvm-project/pull/169126
More information about the llvm-commits
mailing list