[all-commits] [llvm/llvm-project] 34cc21: [clangd] IncludeCleaner: Attribute symbols from no...

Kirill Bobyrev via All-commits all-commits at lists.llvm.org
Fri Nov 26 07:21:12 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34cc210aa8af2fd33598e5559d0f5b51f9423dd6
      https://github.com/llvm/llvm-project/commit/34cc210aa8af2fd33598e5559d0f5b51f9423dd6
  Author: Kirill Bobyrev <kbobyrev at google.com>
  Date:   2021-11-26 (Fri, 26 Nov 2021)

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

  Log Message:
  -----------
  [clangd] IncludeCleaner: Attribute symbols from non self-contained headers to their parents

When a symbol comes from the non self-contained header, we recursively uplift
the file we consider used to the first includer that has a header guard. We
need to do this while we still have FileIDs because every time a non
self-contained header is included, it gets a new FileID but is later
deduplicated by HeaderID and it's not possible to understand where it was
included from.

Based on D114370.

Reviewed By: sammccall

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




More information about the All-commits mailing list