diff options
Diffstat (limited to 'lib/Lex/PreprocessingRecord.cpp')
-rw-r--r-- | lib/Lex/PreprocessingRecord.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp index b37a8cf1ced4..115256db4809 100644 --- a/lib/Lex/PreprocessingRecord.cpp +++ b/lib/Lex/PreprocessingRecord.cpp @@ -1,9 +1,8 @@ //===- PreprocessingRecord.cpp - Record of Preprocessing ------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -239,16 +238,13 @@ unsigned PreprocessingRecord::findBeginLocalPreprocessedEntity( 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(); } @@ -306,10 +302,9 @@ PreprocessingRecord::addPreprocessedEntity(PreprocessedEntity *Entity) { } // 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); |