[PATCH] D91467: ADT: Take small enough, trivially copyable T by value in SmallVector

Nathan James via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 04:09:31 PST 2020


njames93 added a comment.

In D91467#2404392 <https://reviews.llvm.org/D91467#2404392>, @mehdi_amini wrote:

> Oh I didn't read about https://reviews.llvm.org/D87326 before, isn't the work there making obsolete all of the assertions you (and me before) just added by making this behavior safe?

Assertions are great now as a quick fix, however if we can get to the point where SmallVector is able to handle those cases without the compile time regressions observed in D87326 <https://reviews.llvm.org/D87326> we should strive to use that instead. 
It removes contracts that are only enforced in assertion enabled builds which have the potential to cause undefined behaviour in release builds if they slip through the cracks.


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

https://reviews.llvm.org/D91467



More information about the llvm-commits mailing list