summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-12-11 15:40:23 +0100
committerSam McCall <sam.mccall@gmail.com>2019-12-13 16:57:03 +0100
commit22f81250889b2e366187ee1465ba0ec71a6e457d (patch)
tree40589233983328e747e3772efb1bf7849945db31 /clang/lib
parent0eb0992739189dba0d86af33722bc27260a9b555 (diff)
downloadbcm5719-llvm-22f81250889b2e366187ee1465ba0ec71a6e457d.tar.gz
bcm5719-llvm-22f81250889b2e366187ee1465ba0ec71a6e457d.zip
[Tooling/Syntax] Helpers to find spelled tokens touching a location.
Summary: Useful when positions are used to target nodes, with before/after ambiguity. Reviewers: ilya-biryukov, kbobyrev Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71356
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Tooling/Syntax/Tokens.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/Tooling/Syntax/Tokens.cpp b/clang/lib/Tooling/Syntax/Tokens.cpp
index 7c7a442dff0..96595826ddb 100644
--- a/clang/lib/Tooling/Syntax/Tokens.cpp
+++ b/clang/lib/Tooling/Syntax/Tokens.cpp
@@ -254,7 +254,6 @@ syntax::spelledTokensTouching(SourceLocation Loc,
assert(Loc.isFileID());
llvm::ArrayRef<syntax::Token> All =
Tokens.spelledTokens(Tokens.sourceManager().getFileID(Loc));
- // Comparing SourceLocations is well-defined within a FileID.
auto *Right = llvm::partition_point(
All, [&](const syntax::Token &Tok) { return Tok.location() < Loc; });
bool AcceptRight = Right != All.end() && Right->location() <= Loc;
OpenPOWER on IntegriCloud