[PATCH] D93779: ADT: Fix reference invalidation in SmallVector::push_back and single-element insert

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 09:32:25 PST 2021


xbolva00 added a comment.

In D93779#2498509 <https://reviews.llvm.org/D93779#2498509>, @dblaikie wrote:

> In D93779#2498501 <https://reviews.llvm.org/D93779#2498501>, @lebedev.ri wrote:
>
>> Why do we even want to bend over backwards and try to handle broken code correctly,
>> at the cost of regressed performance for everything,
>> instead of just adding defensive asserts against such problems,
>> and letting/telling the user fix the code?
>
> I believe the standard library supports this, so I think it's a somewhat awkward limitation to have a standard-library-like container that misses that. (of course the small-mode isn't entirely compatible with std::vector, etc anyway - so some divergence is possible)

But currently the cost (compile time) is too high to be acceptable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93779



More information about the llvm-commits mailing list