[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-27 Thread Kirill Bobyrev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe3c6090e5976: [clangd] IncludeCleaner: Support macros (authored by kbobyrev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-27 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382550. kbobyrev added a comment. Use IncludeCleaner to clean the includes and clean up a little. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112447/new/ https://reviews.llvm.org/D112447 Files: clang-tool

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-27 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382549. kbobyrev marked 6 inline comments as done. kbobyrev added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112447/new/ https://reviews.llvm.org/D112447 Files: clang-

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-27 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Very nice. As discussed it'd be nice to enhance MainFileMacros at some point but it doesn't seem urgent Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:174 +

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382358. kbobyrev added a comment. Add an elaborate comment on potential future improvements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112447/new/ https://reviews.llvm.org/D112447 Files: clang-tools-ext

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382278. kbobyrev added a comment. Rebase on top of main. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112447/new/ https://reviews.llvm.org/D112447 Files: clang-tools-extra/clangd/IncludeCleaner.cpp clang

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382277. kbobyrev added a comment. Skip the tokens that are not identifiers or weren't defined as macros, attach tracer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112447/new/ https://reviews.llvm.org/D11244

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added inline comments. Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:140 +// locations for the found macros. +void findReferencedMacros(ParsedAST &AST, ReferencedLocations &Result) { + auto Tokens = sammccall wrote: > sammccall wrote: > > can

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 382221. kbobyrev marked 4 inline comments as done. kbobyrev added a comment. Try another strategy to reduce the number of processed tokens (doesn't work in all cases). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:140 +// locations for the found macros. +void findReferencedMacros(ParsedAST &AST, ReferencedLocations &Result) { + auto Tokens = can you add a trace for this and verify tha

[PATCH] D112447: [clangd] IncludeCleaner: Support macros

2021-10-25 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision. kbobyrev added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. kbobyrev requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. Collect the macro definition loc