OSDN Git Service

[ADT] Implement llvm::bsearch() with std::partition_point()
authorFangrui Song <maskray@google.com>
Sun, 30 Jun 2019 09:17:59 +0000 (09:17 +0000)
committerFangrui Song <maskray@google.com>
Sun, 30 Jun 2019 09:17:59 +0000 (09:17 +0000)
commit726837ec5a76b296d2499d3dfea379f36d92e719
treea464125a2f01bea6471188b30fb923d45455c73c
parent146c2833370ec0597044d3a0ec8c029dc5698ae2
[ADT] Implement llvm::bsearch() with std::partition_point()

Summary:
Delete the begin-end form because the standard std::partition_point
can be easily used as a replacement.

The ranges-style llvm::bsearch will be renamed to llvm::partition_point
in the next clean-up patch.

The name "bsearch" doesn't meet people's expectation because in C:

> If two or more members compare equal, which member is returned is unspecified.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D63718

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364719 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/STLExtras.h
include/llvm/CodeGen/SlotIndexes.h
unittests/ADT/STLExtrasTest.cpp