[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D148793#4393386 , @mstorsjo wrote: > In D148793#4393385 , @mgorny wrote: > >> My educated guess would be that `clangIncludeCleaner` is being linked via >> `clang_target_link_libraries`

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-03 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In D148793#4393385 , @mgorny wrote: > My educated guess would be that `clangIncludeCleaner` is being linked via > `clang_target_link_libraries` while it's not part of `libclang-cpp`, so it > should go into regular

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. My educated guess would be that `clangIncludeCleaner` is being linked via `clang_target_link_libraries` while it's not part of `libclang-cpp`, so it should go into regular `target_link_libraries`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-03 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In D148793#4392788 , @mgorny wrote: > I'm getting completely incomprehensible build errors on Gentoo from this I'm also hitting this; it only seems to happen if building with `-DLLVM_LINK_LLVM_DYLIB=ON`. Repository: rG

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. I'm getting completely incomprehensible build errors on Gentoo from this, as of aa7eace8431ba213c5431638b894b0e1b4b481c7 : samu: job failed: : && /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-02 Thread Viktoriia Bakalova via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc28506ba4b69: [clang-tidy] Implement an include-cleaner check. (authored by VitaNuo). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-02 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527839. VitaNuo added a comment. Re-introduce path handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-02 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527822. VitaNuo added a comment. Remove path handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-02 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527812. VitaNuo added a comment. Escape the slashes in regex. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527583. VitaNuo added a comment. Undo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527554. VitaNuo added a comment. Experiment with paths. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527545. VitaNuo added a comment. Undo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527543. VitaNuo added a comment. Fix last test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527509. VitaNuo added a comment. Try ignoring verbatim spelling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527473. VitaNuo added a comment. Try to fix windows build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527457. VitaNuo added a comment. Re-introduce special path handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527402. VitaNuo added a comment. Remove debug statements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527392. VitaNuo marked an inline comment as done. VitaNuo added a comment. Add debug statements for windows debugging. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527385. VitaNuo added a comment. Remove regex and path handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527384. VitaNuo marked an inline comment as done. VitaNuo added a comment. Remove regex and path handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527376. VitaNuo marked an inline comment as done. VitaNuo added a comment. Remove the regular expression. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527369. VitaNuo marked an inline comment as done. VitaNuo added a comment. Remove system-independent handling to see behavior on Windows. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527359. VitaNuo added a comment. Try to fix windows test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, just a few nits. I think it is in a good shape, let's ship it! Please make sure the premerge-test is happy before landing the patch, the windows premerge test is failing now

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo added a comment. Thanks for the comments! Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:88 +SourceLocation Loc = D->getLocation(); +if (!SM->isWrittenInMainFile(SM->getSpellingLoc(Loc))) + continue; hokein wrote: >

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527329. VitaNuo marked 6 inline comments as done. VitaNuo added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527317. VitaNuo added a comment. Update release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The only thing is the source location, see my comments for details, otherwise looks good in general. Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:116 + } + walkUsed(MainFileDecls, RecordedPreprocessor.MacroReferences, , +

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-31 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:186 +- New :doc:`misc-include-cleaner + ` check. Please keep alphabetical order (by check name) in this section. Comment at:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-31 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo added a comment. Thanks for the comments! Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:86 + llvm::SmallVector MainFileDecls; + for (auto *D : Result.Nodes.getNodeAs("top")->decls()) { +SourceLocation Loc = D->getLocation();

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-31 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 527001. VitaNuo marked 25 inline comments as done. VitaNuo added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:170-175 +diag(Inc.SymRefLocation, "missing include %0") +<< Inc.MissingHeaderSpelling +<< FixItHint::CreateInsertion( +

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:45 + SourceLocation SymRefLocation; + std::string MissingHeaderSpelling; +}; storing a string instance for header per system reference is expensive (we might

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-30 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/IncludeCleanerTest.cpp:9 +#include + +using namespace clang::tidy::misc; PiotrZSL wrote: > this test file is fine, but there is no validation of output warning. > nwm, somehow I

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-30 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Not too bad, you on a right road. Tests failed on windows, and clang-format failed. Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:86 + llvm::SmallVector MainFileDecls; + for (auto *D : Result.Nodes.getNodeAs("top")->decls())

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-04-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Is there real advantage in Clang-tidy check versus standalone tool? Comment at: clang-tools-extra/docs/ReleaseNotes.rst:144 + + FIXME: add release notes. + Please add one sentence description. Comment at:

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-04-20 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 515323. VitaNuo added a comment. Remove comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-04-20 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo updated this revision to Diff 515322. VitaNuo added a comment. Add a pragma example. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148793/new/ https://reviews.llvm.org/D148793 Files: clang-tools-extra/clang-tidy/CMakeLists.txt

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-04-20 Thread Viktoriia Bakalova via Phabricator via cfe-commits
VitaNuo created this revision. Herald added subscribers: PiotrZSL, ChuanqiXu, kadircet, carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. VitaNuo requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: