diff options
author | Sam McCall <sam.mccall@gmail.com> | 2022-09-26 03:22:09 +0200 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2022-10-05 18:04:39 +0200 |
commit | 67268ee11c220b1dfdf84afb10a12371c5ae6400 (patch) | |
tree | 2f075ecdf68f9a437727aad5fbf21a72b9bcd034 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | bc8f007fe045139dde244b2374b851f93cc7ed3c (diff) | |
download | llvm-67268ee11c220b1dfdf84afb10a12371c5ae6400.zip llvm-67268ee11c220b1dfdf84afb10a12371c5ae6400.tar.gz llvm-67268ee11c220b1dfdf84afb10a12371c5ae6400.tar.bz2 |
[Syntax] Fix macro-arg handling in TokenBuffer::spelledForExpanded
A few cases were not handled correctly. Notably:
#define ID(X) X
#define HIDE a ID(b)
HIDE
spelledForExpanded() would claim HIDE is an equivalent range of the 'b' it
contains, despite the fact that HIDE also covers 'a'.
While trying to fix this bug, I found findCommonRangeForMacroArgs hard
to understand (both the implementation and how it's used in spelledForExpanded).
It relies on details of the SourceLocation graph that are IMO fairly obscure.
So I've added/revised quite a lot of comments and made some naming tweaks.
Fixes https://github.com/clangd/clangd/issues/1289
Differential Revision: https://reviews.llvm.org/D134618
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions