[PATCH] D50740: [SourceManager] isPointWithin: avoid using isBeforeInTranslationUnit, compare buffer offsets directly for lexical correctness

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 13:59:01 PDT 2018


arphaman added a comment.

In https://reviews.llvm.org/D50740#1202248, @jkorous wrote:

> Hi Alex, nice work!
>
> I am just wondering if it would be beneficial to assert Loc and End are in the same file. It might help to catch bugs.


I don't see the value in that unless I'm misunderstanding something. We already check if Loc and End are in the same file, and return false if they're not.

> I also stumbled upon this function but not sure it makes things significantly cleaner here:
>  https://clang.llvm.org/doxygen/SourceLocation_8h_source.html#l00175
> 
> LGTM otherwise.


Repository:
  rC Clang

https://reviews.llvm.org/D50740





More information about the cfe-commits mailing list