From 2298981669bf3bd63335a4be179bc0f96823a8f4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 20 Aug 2019 20:50:49 +0000 Subject: Vendor import of stripped clang trunk r366426 (just before the release_90 branch point): https://llvm.org/svn/llvm-project/cfe/trunk@366426 --- lib/Lex/PreprocessingRecord.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'lib/Lex/PreprocessingRecord.cpp') 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::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); -- cgit v1.2.3