[PATCH] D135956: [include-cleaner] Add include-cleaner tool, with initial HTML report

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 03:56:56 PDT 2022


sammccall created this revision.
Herald added a subscriber: mgrang.
Herald added a project: All.
sammccall requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

The immediate goal is to start producing an HTML report to debug and explain
include-cleaner recommendations.
For now, this includes only the lowest-level piece: a list of the references
found in the source code.

How this fits into future ideas:

- under refs we can also show the headers providing the symbol, which includes match those headers etc
- we can also annotate the #include lines with which symbols they cover, and add whichever includes we're suggesting too
- the include-cleaner tool will likely have modes where it emits diagnostics and/or applies edits, so the HTML report is behind a flag


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135956

Files:
  clang-tools-extra/include-cleaner/CMakeLists.txt
  clang-tools-extra/include-cleaner/include/clang-include-cleaner/Hooks.h
  clang-tools-extra/include-cleaner/lib/AnalysisInternal.h
  clang-tools-extra/include-cleaner/lib/CMakeLists.txt
  clang-tools-extra/include-cleaner/lib/HTMLReport.cpp
  clang-tools-extra/include-cleaner/lib/Hooks.cpp
  clang-tools-extra/include-cleaner/tool/CMakeLists.txt
  clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135956.467730.patch
Type: text/x-patch
Size: 15710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221014/70ed5f8e/attachment-0001.bin>


More information about the cfe-commits mailing list