[clang] [llvm] [llvm][clang] Remove `llvm::OwningArrayRef` (PR #169126)
David Stone via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 22 10:03:20 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;
----------------
davidstone wrote:
`std::vector` is the most similar to the old code in terms of performance characteristics. `SmallVector` is probably fine here, though, it's just that my goal wasn't to optimize `VTableBuilder` so much as remove the type so I was going for minimal change in this PR.
https://github.com/llvm/llvm-project/pull/169126
More information about the cfe-commits
mailing list