summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-21 05:40:31 +0000
committerFangrui Song <maskray@google.com>2019-06-21 05:40:31 +0000
commitdc8de6037c3aceb9663c7433bb09584fa8571032 (patch)
treeacb49acaa3d1a0428951451a091fcb4d0c79a464 /llvm/lib/IR/DataLayout.cpp
parentd5e1ce3f44b0bef1eadbef9828b87a8918a82669 (diff)
downloadbcm5719-llvm-dc8de6037c3aceb9663c7433bb09584fa8571032.tar.gz
bcm5719-llvm-dc8de6037c3aceb9663c7433bb09584fa8571032.zip
Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC
llvm-svn: 364006
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 943f5381c64..b8c130a54e9 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -463,12 +463,9 @@ DataLayout::AlignmentsTy::iterator
DataLayout::findAlignmentLowerBound(AlignTypeEnum AlignType,
uint32_t BitWidth) {
auto Pair = std::make_pair((unsigned)AlignType, BitWidth);
- return std::lower_bound(Alignments.begin(), Alignments.end(), Pair,
- [](const LayoutAlignElem &LHS,
- const std::pair<unsigned, uint32_t> &RHS) {
- return std::tie(LHS.AlignType, LHS.TypeBitWidth) <
- std::tie(RHS.first, RHS.second);
- });
+ return llvm::bsearch(Alignments, [=](const LayoutAlignElem &E) {
+ return Pair <= std::make_pair(E.AlignType, E.TypeBitWidth);
+ });
}
void
OpenPOWER on IntegriCloud