[PATCH] D105426: [clangd] IWYU as a library: Find all references to symbols in the file

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 6 06:04:25 PDT 2021


sammccall added a comment.

First some thoughts on names... (hopefully to avoid some confusion)

IWYU might be used here to mean three things:

- the IWYU coding style/policy that says you should `#include` headers for the symbols you make use of, and no others
- the IWYU <https://github.com/include-what-you-use/include-what-you-use> tool which applies IWYU style to files
- more generally, features that encourage hygiene policies for `#includes` ("IWYU functionality")

This work is about the last of these: putting header hygiene features in clangd. (Specifically, likely unused-include and missing-include warnings).
I think we should avoid the name "IWYU as a library" or "IWYU functionality" as it's ambiguous and also misleading:

- policy: we're likely to support policies other than the IWYU style
- tool: it's not likely to match the design or feature set of the IWYU tool

IncludeHygiene would be an ok name I think but a bit of a mouthful.  WDYT?

(This work is definitely inspired by the IWYU tool and I'd used the name in discussions/prototypes, so this confusion is largely my fault! We also did this with clang-include-fixer which ended up as clangd/IncludeFixer.h, though the designs are much more similar)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105426



More information about the cfe-commits mailing list