OSDN Git Service

ADT: Fix pointer comparison UB in SmallVector
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 23 Dec 2020 21:17:45 +0000 (13:17 -0800)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 11 Jan 2021 23:31:04 +0000 (15:31 -0800)
commit5ccff5aaa68ab789834c4463ce05b05e57593b34
treed86c3070dab3a545dd33aabcb60d2be7be3ae268
parentec8a6c11db4102ec249ce90084b3f615c5de15e5
ADT: Fix pointer comparison UB in SmallVector

The standard requires comparisons of pointers to unrelated storage to
use `std::less`. Split out some helpers that do that and update all the
code that was comparing using `<` and friends (mostly assertions).

Differential Revision: https://reviews.llvm.org/D93777
llvm/include/llvm/ADT/SmallVector.h