Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/apple/stable/20190619' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
shahmishal committed Oct 2, 2019
2 parents 970f30b + eeafed2 commit 25814dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Tooling/Syntax/Tokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ TokenBuffer::spelledForExpandedToken(const syntax::Token *Expanded) const {

unsigned ExpandedIndex = Expanded - ExpandedTokens.data();
// Find the first mapping that produced tokens after \p Expanded.
auto It = llvm::bsearch(File.Mappings, [&](const Mapping &M) {
return ExpandedIndex < M.BeginExpanded;
auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) {
return M.BeginExpanded <= ExpandedIndex;
});
// Our token could only be produced by the previous mapping.
if (It == File.Mappings.begin()) {
Expand Down Expand Up @@ -211,8 +211,8 @@ TokenBuffer::expansionStartingAt(const syntax::Token *Spelled) const {
Spelled < (File.SpelledTokens.data() + File.SpelledTokens.size()));

unsigned SpelledIndex = Spelled - File.SpelledTokens.data();
auto M = llvm::bsearch(File.Mappings, [&](const Mapping &M) {
return SpelledIndex <= M.BeginSpelled;
auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) {
return M.BeginSpelled < SpelledIndex;
});
if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex)
return llvm::None;
Expand Down

0 comments on commit 25814dd

Please sign in to comment.