Our previous definition of "top-level" was too informal, and didn't
allow for overlapping macros that each directly produce expanded tokens.
See D77507 for previous discussion.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM, thanks!
clang/lib/Tooling/Syntax/Tokens.cpp | ||
---|---|---|
452 | instead of saying A and B maybe say something like, a the last token for a top-level macro expansion must be inside a file and invert the following condition: if(!Range.getEnd().isFileID()) return; | |
462 | maybe put As and Bs in parentheses, i.e: // If the macro invocation (B) starts in a macro (A) but ends in a file, we'll // create a merged mapping (for A & B) by overwriting the endpoint for parent's (A's) // startpoint. |
clang/lib/Tooling/Syntax/Tokens.cpp | ||
---|---|---|
462 | Done, except for "parent" - the point here is there isn't really a parent/child relationship here: the arg list isn't part of the A expansion in any sense. |
instead of saying A and B maybe say something like, a the last token for a top-level macro expansion must be inside a file and invert the following condition:
if(!Range.getEnd().isFileID()) return;