[PATCH] D154335: [clang][tooling] Fix early termination when there are nested expansions

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 3 04:40:55 PDT 2023


kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added a subscriber: arphaman.
Herald added a project: All.
kadircet requested review of this revision.
Herald added projects: clang, clang-tools-extra.
Herald added a subscriber: cfe-commits.

This also does some cleanups, I am happy to undo them (or send as
separate patches):

- Change the early exit to stop only once we hit an expansion inside the main file, to make sure we keep following the nested expansions.
- Add more tests to cover all the cases mentioned in the implementation
- Drop the adjustments for prev/next tokens. We do the final checks based on the expansion locations anyway, so any intermediate mapping was a no-op.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154335

Files:
  clang-tools-extra/clangd/unittests/tweaks/AddUsingTests.cpp
  clang/lib/Tooling/Syntax/Tokens.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154335.536719.patch
Type: text/x-patch
Size: 7153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230703/1d82bf1c/attachment.bin>


More information about the cfe-commits mailing list