This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Dont work on diags if we are not going to emit
ClosedPublic

Authored by kadircet on Sep 16 2021, 7:14 AM.

Details

Summary

Doesn't install clang-tidy checks & process clang diags when they're
going to be dropped. Also disables analysis for some warnings completely.

Diff Detail

Event Timeline

kadircet created this revision.Sep 16 2021, 7:14 AM
kadircet requested review of this revision.Sep 16 2021, 7:14 AM
kadircet updated this revision to Diff 372938.Sep 16 2021, 7:20 AM
  • Disable IncludeFixer too.

Great!

clang-tools-extra/clangd/ParsedAST.cpp
300

These explicit upcasts seem ugly enough that I might extract a pointer var to avoid them...

342–343

s/initialize a clang-tidy context/run clang-tidy/

clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
464

Why are these tests deleted?

kadircet added inline comments.Sep 16 2021, 7:29 AM
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
464

they rely on the fact that clang-tidy checkers PPcallbacks are run with patched asts, but it is no longer the case, hence it becomes impossible to satisfy them.

currently we never replay includes with patched preambles, as ReplayPreamble bails out when there are no existing PPCallbacks and that's always the case. we can still try and test it via complicated means like enabling ClangdFeatures to register PPCallbacks, but it will be testing a feature that doesn't exist in practice + would be quite some work for just testing, so I'd rather leave it as-is (probably by adding a comment around ReplayPreamble::attach saying that we should test this once there are non-clang-tidy users).

sammccall accepted this revision.Sep 16 2021, 7:38 AM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
464

Oops, I didn't scroll up fast enough (reviewing on phone lol). SGTM

This revision is now accepted and ready to land.Sep 16 2021, 7:38 AM
kadircet updated this revision to Diff 372943.Sep 16 2021, 7:40 AM
kadircet marked 2 inline comments as done.
  • Get rid of static_casts
  • Update comments
kadircet updated this revision to Diff 372947.Sep 16 2021, 7:44 AM
  • Revert revert of IncludeFixer changes
This revision was landed with ongoing or failed builds.Sep 16 2021, 7:55 AM
This revision was automatically updated to reflect the committed changes.