diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:49 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:49 +0000 |
commit | 2298981669bf3bd63335a4be179bc0f96823a8f4 (patch) | |
tree | 1cbe2eb27f030d2d70b80ee5ca3c86bee7326a9f /lib/Lex/PreprocessingRecord.cpp | |
parent | 9a83721404652cea39e9f02ae3e3b5c964602a5c (diff) |
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); |