[PATCH] D155540: [clangd] Remove extra dependancies for clangd

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 16:02:08 PDT 2023


MaskRay added a comment.

`llvm/cmake/modules/HandleLLVMOptions.cmake` passes `-Wl,-z,defs`. `-DBUILD_SHARED_LIBS=on` builds get checking from the linker option (https://maskray.me/blog/2021-06-13-dependency-related-linker-options#z-defs). This is similar Bazel's layering_check.

For a dependency, say, `clangTooling`, if a source file within the `clangd` target (executable) uses (directly or transitively) clangTooling, the dependency should be kept, otherwise it should be removed.
If the source files are completely IWYU clean, it should be straightforward to tell whether a dependency can be removed by inspecting the `#include` lines.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155540/new/

https://reviews.llvm.org/D155540



More information about the cfe-commits mailing list