[PATCH] D87326: [ADT] Fix reference invalidation when self referencing a SmallVector

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 22:23:30 PDT 2020


MaskRay added a comment.

I have checked every GrowBuffer<T> use site. They look good!



================
Comment at: llvm/include/llvm/ADT/SmallVector.h:343
+
+  void swap_out_split_buffer(SmallVectorTemplateCommon<T> &Vec,
+                             Size_T SplitIndex) {
----------------
The libc++ implementation (`__swap_out_circular_buffer`) returns a pointer so that the call sites do not need `this->begin() + EltNo`. Have you thought about adopting it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87326/new/

https://reviews.llvm.org/D87326



More information about the llvm-commits mailing list