[PATCH] D71356: [Tooling/Syntax] Helpers to find spelled tokens touching a location.

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 02:18:42 PST 2019


kbobyrev added inline comments.


================
Comment at: clang/lib/Tooling/Syntax/Tokens.cpp:260
+      All, [&](const syntax::Token &Tok) { return Tok.location() < Loc; });
+  bool AcceptRight = Right != All.end() && !(Loc < Right->location());
+  bool AcceptLeft = Right != All.begin() && !((Right - 1)->endLocation() < Loc);
----------------
ilya-biryukov wrote:
> NIT: why not `Right->location() <= Loc` instead of `!(Loc < Right->location)`?
> Do we only overload `operator <` for `SourceLocations`?
Yes, we only have operator< :(


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71356/new/

https://reviews.llvm.org/D71356





More information about the cfe-commits mailing list