[PATCH] D93780: ADT: Fix reference invalidation in N-element SmallVector::append and insert

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 14:02:40 PST 2020


dexonsmith created this revision.
dexonsmith added a reviewer: dblaikie.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.
Herald added a project: LLVM.

For small enough, trivially copyable `T`, take the parameter by-value in
`SmallVector::append` and `SmallVector::insert`.  Otherwise, when
growing, update the argument appropriately.

Depends on https://reviews.llvm.org/D93779.
Split out from https://reviews.llvm.org/D91837.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93780

Files:
  llvm/include/llvm/ADT/SmallVector.h
  llvm/unittests/ADT/SmallVectorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93780.313613.patch
Type: text/x-patch
Size: 6810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201223/5507862d/attachment.bin>


More information about the llvm-commits mailing list