[clangd] IncludeCleaner: Don't warn on system headers
authorKirill Bobyrev <kbobyrev@google.com>
Wed, 27 Oct 2021 09:50:35 +0000 (11:50 +0200)
committerKirill Bobyrev <kbobyrev@google.com>
Wed, 27 Oct 2021 09:51:08 +0000 (11:51 +0200)
commitc4723785c1902d6a53f3808fa1dabb2a97c1cc6e
tree7d1165fe946d0e4be3208eccc4b890484f671bc9
parent897402e95988d41d7be88075f80a35ecdbc10d52
[clangd] IncludeCleaner: Don't warn on system headers

This is a temporary hack to disable diagnostics for system headers. As of right
now, IncludeCleaner does not handle the Standard Library correctly and will
report most system headers as unused because very few symbols are defined in
top-level system headers. This will eventually be fixed, but for now we are
aiming for the most conservative approach with as little false-positive
warnings as possible. After the initial prototype and core functionality is
polished, I will turn back to handling the Standard Library as it requires
custom logic.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D112571
clang-tools-extra/clangd/IncludeCleaner.cpp
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp