Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or llvm::partition_point. NFC
llvm-svn: 365006
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index e8bcc83..92951a8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -2701,8 +2701,7 @@
const TargetInfo &TI = Context.getTargetInfo();
const BuiltinAndString *FC =
- std::lower_bound(std::begin(ValidCPU), std::end(ValidCPU), BuiltinID,
- LowerBoundCmp);
+ llvm::lower_bound(ValidCPU, BuiltinID, LowerBoundCmp);
if (FC != std::end(ValidCPU) && FC->BuiltinID == BuiltinID) {
const TargetOptions &Opts = TI.getTargetOpts();
StringRef CPU = Opts.CPU;
@@ -2718,8 +2717,7 @@
}
const BuiltinAndString *FH =
- std::lower_bound(std::begin(ValidHVX), std::end(ValidHVX), BuiltinID,
- LowerBoundCmp);
+ llvm::lower_bound(ValidHVX, BuiltinID, LowerBoundCmp);
if (FH != std::end(ValidHVX) && FH->BuiltinID == BuiltinID) {
if (!TI.hasFeature("hvx"))
return Diag(TheCall->getBeginLoc(),
@@ -2948,11 +2946,8 @@
true);
(void)SortOnce;
- const BuiltinInfo *F =
- std::lower_bound(std::begin(Infos), std::end(Infos), BuiltinID,
- [](const BuiltinInfo &BI, unsigned BuiltinID) {
- return BI.BuiltinID < BuiltinID;
- });
+ const BuiltinInfo *F = llvm::partition_point(
+ Infos, [=](const BuiltinInfo &BI) { return BI.BuiltinID < BuiltinID; });
if (F == std::end(Infos) || F->BuiltinID != BuiltinID)
return false;
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 3b149e6..0e5881e3 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -1041,9 +1041,8 @@
// Find the smallest value >= the lower bound. If I is in the
// case range, then we have overlap.
- CaseValsTy::iterator I = std::lower_bound(CaseVals.begin(),
- CaseVals.end(), CRLo,
- CaseCompareFunctor());
+ CaseValsTy::iterator I =
+ llvm::lower_bound(CaseVals, CRLo, CaseCompareFunctor());
if (I != CaseVals.end() && I->first < CRHi) {
OverlapVal = I->first; // Found overlap with scalar.
OverlapStmt = I->second;