[all-commits] [llvm/llvm-project] 6fa0e0: [include-cleaner] Add include-cleaner tool, with i...

Sam McCall via All-commits all-commits at lists.llvm.org
Tue Oct 18 09:21:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fa0e026c87e20b962137691a7852fb5e32f9611
      https://github.com/llvm/llvm-project/commit/6fa0e026c87e20b962137691a7852fb5e32f9611
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-10-18 (Tue, 18 Oct 2022)

  Changed paths:
    M clang-tools-extra/include-cleaner/CMakeLists.txt
    A clang-tools-extra/include-cleaner/include/clang-include-cleaner/Record.h
    M clang-tools-extra/include-cleaner/lib/AnalysisInternal.h
    M clang-tools-extra/include-cleaner/lib/CMakeLists.txt
    A clang-tools-extra/include-cleaner/lib/HTMLReport.cpp
    A clang-tools-extra/include-cleaner/lib/Record.cpp
    A clang-tools-extra/include-cleaner/test/Inputs/bar.h
    A clang-tools-extra/include-cleaner/test/Inputs/foo.h
    A clang-tools-extra/include-cleaner/test/html.cpp
    A clang-tools-extra/include-cleaner/tool/CMakeLists.txt
    A clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp
    M clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
    A clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
    M clang/include/clang/Testing/TestAST.h
    M clang/lib/Testing/TestAST.cpp

  Log Message:
  -----------
  [include-cleaner] Add include-cleaner tool, with initial HTML report

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

Differential Revision: https://reviews.llvm.org/D135956




More information about the All-commits mailing list