[all-commits] [llvm/llvm-project] d1ec58: [clangd] IncludeCleaner as a library: Find all ref...

Kirill Bobyrev via All-commits all-commits at lists.llvm.org
Wed Aug 18 01:10:22 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1ec581ebfca9bd455ae1a467b2d4b52fc59092b
      https://github.com/llvm/llvm-project/commit/d1ec581ebfca9bd455ae1a467b2d4b52fc59092b
  Author: Kirill Bobyrev <kbobyrev at google.com>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M clang-tools-extra/clangd/CMakeLists.txt
    A clang-tools-extra/clangd/IncludeCleaner.cpp
    A clang-tools-extra/clangd/IncludeCleaner.h
    M clang-tools-extra/clangd/unittests/CMakeLists.txt
    A clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp

  Log Message:
  -----------
  [clangd] IncludeCleaner as a library: Find all references to symbols in the file

This is the first patch in an ongoing attempt of Include Cleaner: unused/missing
headere diagnostics, an IWYU-like functionality implementation for clangd. The
work is split into (mostly) distinct and parallelizable pieces:

- Finding all referenced locations (this patch).
- Finding all referenced locations of macros.
- Building IncludeGraph and marking headers as unused, used and directly used.
- Making use of the introduced library and add an option to use in clangd.

---

* Adding support for standard library headers (possibly through mapping
  genfiles).

Based on https://reviews.llvm.org/D100540.

Reviewed By: sammccall

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




More information about the All-commits mailing list