r365006 - Change std::{lower, upper}_bound to llvm::{lower, upper}_bound or llvm::partition_point. NFC
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 3 01:13:17 PDT 2019
Author: maskray
Date: Wed Jul 3 01:13:17 2019
New Revision: 365006
URL: http://llvm.org/viewvc/llvm-project?rev=365006&view=rev
Log:
Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or llvm::partition_point. NFC
Modified:
cfe/trunk/include/clang/Serialization/ContinuousRangeMap.h
cfe/trunk/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/AST/DeclCXX.cpp
cfe/trunk/lib/Basic/Diagnostic.cpp
cfe/trunk/lib/Basic/DiagnosticIDs.cpp
cfe/trunk/lib/Basic/SourceManager.cpp
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Index/FileIndexRecord.cpp
cfe/trunk/lib/Lex/PPConditionalDirectiveRecord.cpp
cfe/trunk/lib/Lex/PreprocessingRecord.cpp
cfe/trunk/lib/Parse/ParseStmtAsm.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
cfe/trunk/lib/Tooling/InterpolatingCompilationDatabase.cpp
cfe/trunk/tools/diagtool/DiagnosticNames.cpp
cfe/trunk/tools/diagtool/TreeView.cpp
Modified: cfe/trunk/include/clang/Serialization/ContinuousRangeMap.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ContinuousRangeMap.h?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ContinuousRangeMap.h (original)
+++ cfe/trunk/include/clang/Serialization/ContinuousRangeMap.h Wed Jul 3 01:13:17 2019
@@ -73,7 +73,7 @@ public:
}
void insertOrReplace(const value_type &Val) {
- iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare());
+ iterator I = llvm::lower_bound(Rep, Val, Compare());
if (I != Rep.end() && I->first == Val.first) {
I->second = Val.second;
return;
@@ -91,7 +91,7 @@ public:
const_iterator end() const { return Rep.end(); }
iterator find(Int K) {
- iterator I = std::upper_bound(Rep.begin(), Rep.end(), K, Compare());
+ iterator I = llvm::upper_bound(Rep, K, Compare());
// I points to the first entry with a key > K, which is the range that
// follows the one containing K.
if (I == Rep.begin())
Modified: cfe/trunk/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp Wed Jul 3 01:13:17 2019
@@ -42,9 +42,8 @@ static bool isEmptyARCMTMacroStatement(N
return false;
SourceManager &SM = Ctx.getSourceManager();
- std::vector<SourceLocation>::iterator
- I = std::upper_bound(MacroLocs.begin(), MacroLocs.end(), SemiLoc,
- BeforeThanCompare<SourceLocation>(SM));
+ std::vector<SourceLocation>::iterator I = llvm::upper_bound(
+ MacroLocs, SemiLoc, BeforeThanCompare<SourceLocation>(SM));
--I;
SourceLocation
AfterMacroLoc = I->getLocWithOffset(getARCMTMacroName().size());
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Jul 3 01:13:17 2019
@@ -228,12 +228,11 @@ RawComment *ASTContext::getRawCommentFor
if (Found) {
Comment = MaybeBeforeDecl + 1;
- assert(Comment == std::lower_bound(RawComments.begin(), RawComments.end(),
- &CommentAtDeclLoc, Compare));
+ assert(Comment ==
+ llvm::lower_bound(RawComments, &CommentAtDeclLoc, Compare));
} else {
// Slow path.
- Comment = std::lower_bound(RawComments.begin(), RawComments.end(),
- &CommentAtDeclLoc, Compare);
+ Comment = llvm::lower_bound(RawComments, &CommentAtDeclLoc, Compare);
}
}
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Wed Jul 3 01:13:17 2019
@@ -1450,10 +1450,8 @@ CXXRecordDecl::getLambdaExplicitTemplate
[](const NamedDecl *D) { return !D->isImplicit(); })
&& "Explicit template params should be ordered before implicit ones");
- const auto ExplicitEnd = std::lower_bound(List->begin(), List->end(), false,
- [](const NamedDecl *D, bool) {
- return !D->isImplicit();
- });
+ const auto ExplicitEnd = llvm::partition_point(
+ *List, [](const NamedDecl *D) { return !D->isImplicit(); });
return llvm::makeArrayRef(List->begin(), ExplicitEnd);
}
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Wed Jul 3 01:13:17 2019
@@ -205,10 +205,9 @@ DiagnosticsEngine::DiagStateMap::lookup(
DiagnosticsEngine::DiagState *
DiagnosticsEngine::DiagStateMap::File::lookup(unsigned Offset) const {
- auto OnePastIt = std::upper_bound(
- StateTransitions.begin(), StateTransitions.end(), Offset,
- [](unsigned Offset, const DiagStatePoint &P) {
- return Offset < P.Offset;
+ auto OnePastIt =
+ llvm::partition_point(StateTransitions, [=](const DiagStatePoint &P) {
+ return P.Offset <= Offset;
});
assert(OnePastIt != StateTransitions.begin() && "missing initial state");
return OnePastIt[-1].State;
Modified: cfe/trunk/lib/Basic/DiagnosticIDs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/DiagnosticIDs.cpp (original)
+++ cfe/trunk/lib/Basic/DiagnosticIDs.cpp Wed Jul 3 01:13:17 2019
@@ -580,11 +580,8 @@ static bool getDiagnosticsInGroup(diag::
bool
DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
SmallVectorImpl<diag::kind> &Diags) const {
- auto Found = std::lower_bound(std::begin(OptionTable), std::end(OptionTable),
- Group,
- [](const WarningOption &LHS, StringRef RHS) {
- return LHS.getName() < RHS;
- });
+ auto Found = llvm::partition_point(
+ OptionTable, [=](const WarningOption &O) { return O.getName() < Group; });
if (Found == std::end(OptionTable) || Found->getName() != Group)
return true; // Option not found.
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Wed Jul 3 01:13:17 2019
@@ -277,9 +277,9 @@ const LineEntry *LineTableInfo::FindNear
return &Entries.back();
// Do a binary search to find the maximal element that is still before Offset.
- std::vector<LineEntry>::const_iterator I =
- std::upper_bound(Entries.begin(), Entries.end(), Offset);
- if (I == Entries.begin()) return nullptr;
+ std::vector<LineEntry>::const_iterator I = llvm::upper_bound(Entries, Offset);
+ if (I == Entries.begin())
+ return nullptr;
return &*--I;
}
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jul 3 01:13:17 2019
@@ -5076,8 +5076,7 @@ findNeonIntrinsicInMap(ArrayRef<NeonIntr
}
#endif
- const NeonIntrinsicInfo *Builtin =
- std::lower_bound(IntrinsicMap.begin(), IntrinsicMap.end(), BuiltinID);
+ const NeonIntrinsicInfo *Builtin = llvm::lower_bound(IntrinsicMap, BuiltinID);
if (Builtin != IntrinsicMap.end() && Builtin->BuiltinID == BuiltinID)
return Builtin;
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Wed Jul 3 01:13:17 2019
@@ -288,7 +288,7 @@ Optional<size_t> ConstantAggregateBuilde
return Offsets.size();
while (true) {
- auto FirstAfterPos = std::upper_bound(Offsets.begin(), Offsets.end(), Pos);
+ auto FirstAfterPos = llvm::upper_bound(Offsets, Pos);
if (FirstAfterPos == Offsets.begin())
return 0;
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Jul 3 01:13:17 2019
@@ -2447,8 +2447,8 @@ void ASTUnit::addFileLevelDecl(Decl *D)
return;
}
- LocDeclsTy::iterator I = std::upper_bound(Decls->begin(), Decls->end(),
- LocDecl, llvm::less_first());
+ LocDeclsTy::iterator I =
+ llvm::upper_bound(*Decls, LocDecl, llvm::less_first());
Decls->insert(I, LocDecl);
}
@@ -2473,9 +2473,9 @@ void ASTUnit::findFileRegionDecls(FileID
return;
LocDeclsTy::iterator BeginIt =
- std::lower_bound(LocDecls.begin(), LocDecls.end(),
- std::make_pair(Offset, (Decl *)nullptr),
- llvm::less_first());
+ llvm::partition_point(LocDecls, [=](std::pair<unsigned, Decl *> LD) {
+ return LD.first < Offset;
+ });
if (BeginIt != LocDecls.begin())
--BeginIt;
@@ -2486,9 +2486,9 @@ void ASTUnit::findFileRegionDecls(FileID
BeginIt->second->isTopLevelDeclInObjCContainer())
--BeginIt;
- LocDeclsTy::iterator EndIt = std::upper_bound(
- LocDecls.begin(), LocDecls.end(),
- std::make_pair(Offset + Length, (Decl *)nullptr), llvm::less_first());
+ LocDeclsTy::iterator EndIt = llvm::upper_bound(
+ LocDecls, std::make_pair(Offset + Length, (Decl *)nullptr),
+ llvm::less_first());
if (EndIt != LocDecls.end())
++EndIt;
Modified: cfe/trunk/lib/Index/FileIndexRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/FileIndexRecord.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Index/FileIndexRecord.cpp (original)
+++ cfe/trunk/lib/Index/FileIndexRecord.cpp Wed Jul 3 01:13:17 2019
@@ -36,7 +36,7 @@ void FileIndexRecord::addDeclOccurence(S
DeclOccurrence NewInfo(Roles, Offset, D, Relations);
// We keep Decls in order as we need to access them in this order in all cases.
- auto It = std::upper_bound(Decls.begin(), Decls.end(), NewInfo);
+ auto It = llvm::upper_bound(Decls, NewInfo);
Decls.insert(It, std::move(NewInfo));
}
Modified: cfe/trunk/lib/Lex/PPConditionalDirectiveRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPConditionalDirectiveRecord.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPConditionalDirectiveRecord.cpp (original)
+++ cfe/trunk/lib/Lex/PPConditionalDirectiveRecord.cpp Wed Jul 3 01:13:17 2019
@@ -25,9 +25,8 @@ bool PPConditionalDirectiveRecord::range
if (Range.isInvalid())
return false;
- CondDirectiveLocsTy::const_iterator
- low = std::lower_bound(CondDirectiveLocs.begin(), CondDirectiveLocs.end(),
- Range.getBegin(), CondDirectiveLoc::Comp(SourceMgr));
+ CondDirectiveLocsTy::const_iterator low = llvm::lower_bound(
+ CondDirectiveLocs, Range.getBegin(), CondDirectiveLoc::Comp(SourceMgr));
if (low == CondDirectiveLocs.end())
return false;
@@ -55,9 +54,8 @@ SourceLocation PPConditionalDirectiveRec
Loc))
return CondDirectiveStack.back();
- CondDirectiveLocsTy::const_iterator
- low = std::lower_bound(CondDirectiveLocs.begin(), CondDirectiveLocs.end(),
- Loc, CondDirectiveLoc::Comp(SourceMgr));
+ CondDirectiveLocsTy::const_iterator low = llvm::lower_bound(
+ CondDirectiveLocs, Loc, CondDirectiveLoc::Comp(SourceMgr));
assert(low != CondDirectiveLocs.end());
return low->getRegionLoc();
}
Modified: cfe/trunk/lib/Lex/PreprocessingRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PreprocessingRecord.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PreprocessingRecord.cpp (original)
+++ cfe/trunk/lib/Lex/PreprocessingRecord.cpp Wed Jul 3 01:13:17 2019
@@ -238,16 +238,13 @@ unsigned PreprocessingRecord::findBeginL
return First - PreprocessedEntities.begin();
}
-unsigned PreprocessingRecord::findEndLocalPreprocessedEntity(
- SourceLocation Loc) const {
+unsigned
+PreprocessingRecord::findEndLocalPreprocessedEntity(SourceLocation Loc) const {
if (SourceMgr.isLoadedSourceLocation(Loc))
return 0;
- std::vector<PreprocessedEntity *>::const_iterator
- I = std::upper_bound(PreprocessedEntities.begin(),
- PreprocessedEntities.end(),
- Loc,
- PPEntityComp<&SourceRange::getBegin>(SourceMgr));
+ auto I = llvm::upper_bound(PreprocessedEntities, Loc,
+ PPEntityComp<&SourceRange::getBegin>(SourceMgr));
return I - PreprocessedEntities.begin();
}
@@ -305,10 +302,9 @@ PreprocessingRecord::addPreprocessedEnti
}
// Linear search unsuccessful. Do a binary search.
- pp_iter I = std::upper_bound(PreprocessedEntities.begin(),
- PreprocessedEntities.end(),
- BeginLoc,
- PPEntityComp<&SourceRange::getBegin>(SourceMgr));
+ pp_iter I =
+ llvm::upper_bound(PreprocessedEntities, BeginLoc,
+ PPEntityComp<&SourceRange::getBegin>(SourceMgr));
pp_iter insertI = PreprocessedEntities.insert(I, Entity);
return getPPEntityID(insertI - PreprocessedEntities.begin(),
/*isLoaded=*/false);
Modified: cfe/trunk/lib/Parse/ParseStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmtAsm.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmtAsm.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmtAsm.cpp Wed Jul 3 01:13:17 2019
@@ -144,8 +144,8 @@ void ClangAsmParserCallback::findTokensF
// Try to find a token whose offset matches the first token.
unsigned FirstCharOffset = Str.begin() - AsmString.begin();
- const unsigned *FirstTokOffset = std::lower_bound(
- AsmTokOffsets.begin(), AsmTokOffsets.end(), FirstCharOffset);
+ const unsigned *FirstTokOffset =
+ llvm::lower_bound(AsmTokOffsets, FirstCharOffset);
// For now, assert that the start of the string exactly
// corresponds to the start of a token.
@@ -174,8 +174,7 @@ ClangAsmParserCallback::translateLocatio
unsigned Offset = SMLoc.getPointer() - LBuf->getBufferStart();
// Figure out which token that offset points into.
- const unsigned *TokOffsetPtr =
- std::lower_bound(AsmTokOffsets.begin(), AsmTokOffsets.end(), Offset);
+ const unsigned *TokOffsetPtr = llvm::lower_bound(AsmTokOffsets, Offset);
unsigned TokIndex = TokOffsetPtr - AsmTokOffsets.begin();
unsigned TokOffset = *TokOffsetPtr;
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Jul 3 01:13:17 2019
@@ -2701,8 +2701,7 @@ bool Sema::CheckHexagonBuiltinCpu(unsign
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 @@ bool Sema::CheckHexagonBuiltinCpu(unsign
}
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 @@ bool Sema::CheckHexagonBuiltinArgument(u
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;
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Jul 3 01:13:17 2019
@@ -1041,9 +1041,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocati
// 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;
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Jul 3 01:13:17 2019
@@ -7948,9 +7948,8 @@ void ASTReader::FindFileRegionDecls(File
SourceLocation EndLoc = BeginLoc.getLocWithOffset(Length);
DeclIDComp DIDComp(*this, *DInfo.Mod);
- ArrayRef<serialization::LocalDeclID>::iterator
- BeginIt = std::lower_bound(DInfo.Decls.begin(), DInfo.Decls.end(),
- BeginLoc, DIDComp);
+ ArrayRef<serialization::LocalDeclID>::iterator BeginIt =
+ llvm::lower_bound(DInfo.Decls, BeginLoc, DIDComp);
if (BeginIt != DInfo.Decls.begin())
--BeginIt;
@@ -7962,9 +7961,8 @@ void ASTReader::FindFileRegionDecls(File
->isTopLevelDeclInObjCContainer())
--BeginIt;
- ArrayRef<serialization::LocalDeclID>::iterator
- EndIt = std::upper_bound(DInfo.Decls.begin(), DInfo.Decls.end(),
- EndLoc, DIDComp);
+ ArrayRef<serialization::LocalDeclID>::iterator EndIt =
+ llvm::upper_bound(DInfo.Decls, EndLoc, DIDComp);
if (EndIt != DInfo.Decls.end())
++EndIt;
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Jul 3 01:13:17 2019
@@ -5707,7 +5707,7 @@ void ASTWriter::associateDeclWithFile(co
}
LocDeclIDsTy::iterator I =
- std::upper_bound(Decls.begin(), Decls.end(), LocDecl, llvm::less_first());
+ llvm::upper_bound(Decls, LocDecl, llvm::less_first());
Decls.insert(I, LocDecl);
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp Wed Jul 3 01:13:17 2019
@@ -274,15 +274,13 @@ public:
long long CurAlignmentBits = 1ull << (std::min)(TrailingZeros, 62u);
CharUnits CurAlignment = CharUnits::fromQuantity(CurAlignmentBits);
FieldInfo InsertPoint = {CurAlignment, CharUnits::Zero(), nullptr};
- auto CurBegin = Fields.begin();
- auto CurEnd = Fields.end();
// In the typical case, this will find the last element
// of the vector. We won't find a middle element unless
// we started on a poorly aligned address or have an overly
// aligned field.
- auto Iter = std::upper_bound(CurBegin, CurEnd, InsertPoint);
- if (Iter != CurBegin) {
+ auto Iter = llvm::upper_bound(Fields, InsertPoint);
+ if (Iter != Fields.begin()) {
// We found a field that we can layout with the current alignment.
--Iter;
NewOffset += Iter->Size;
Modified: cfe/trunk/lib/Tooling/InterpolatingCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/InterpolatingCompilationDatabase.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/InterpolatingCompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/InterpolatingCompilationDatabase.cpp Wed Jul 3 01:13:17 2019
@@ -478,8 +478,7 @@ private:
ArrayRef<SubstringAndIndex> Idx) const {
assert(!Idx.empty());
// Longest substring match will be adjacent to a direct lookup.
- auto It =
- std::lower_bound(Idx.begin(), Idx.end(), SubstringAndIndex{Key, 0});
+ auto It = llvm::lower_bound(Idx, SubstringAndIndex{Key, 0});
if (It == Idx.begin())
return *It;
if (It == Idx.end())
Modified: cfe/trunk/tools/diagtool/DiagnosticNames.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/DiagnosticNames.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/tools/diagtool/DiagnosticNames.cpp (original)
+++ cfe/trunk/tools/diagtool/DiagnosticNames.cpp Wed Jul 3 01:13:17 2019
@@ -54,9 +54,7 @@ const DiagnosticRecord &diagtool::getDia
DiagnosticRecord Key = {nullptr, DiagID, 0};
const DiagnosticRecord *Result =
- std::lower_bound(std::begin(BuiltinDiagnosticsByID),
- std::end(BuiltinDiagnosticsByID),
- Key, orderByID);
+ llvm::lower_bound(BuiltinDiagnosticsByID, Key, orderByID);
assert(Result && "diagnostic not found; table may be out of date");
return *Result;
}
Modified: cfe/trunk/tools/diagtool/TreeView.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/TreeView.cpp?rev=365006&r1=365005&r2=365006&view=diff
==============================================================================
--- cfe/trunk/tools/diagtool/TreeView.cpp (original)
+++ cfe/trunk/tools/diagtool/TreeView.cpp Wed Jul 3 01:13:17 2019
@@ -102,9 +102,7 @@ public:
return 1;
}
- const GroupRecord *Found =
- std::lower_bound(AllGroups.begin(), AllGroups.end(), RootGroup);
-
+ const GroupRecord *Found = llvm::lower_bound(AllGroups, RootGroup);
if (Found == AllGroups.end() || Found->getName() != RootGroup) {
llvm::errs() << "No such diagnostic group exists\n";
return 1;
More information about the cfe-commits
mailing list