[all-commits] [llvm/llvm-project] 73453e: [clangd] Avoid expensive checks of buffer names in...

Sam McCall via All-commits all-commits at lists.llvm.org
Wed Oct 27 23:01:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73453e7adecbcc7208ceb70d5e55086ffbd1de3a
      https://github.com/llvm/llvm-project/commit/73453e7adecbcc7208ceb70d5e55086ffbd1de3a
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2021-10-28 (Thu, 28 Oct 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] Avoid expensive checks of buffer names in IncludeCleaner

This changes the handling of special buffers (<command-line> etc) that
SourceManager treats as files but FileManager does not.

We now include them in findReferencedFiles() and drop them as part of
translateToHeaderIDs(). This pairs more naturally with the data representations
we're using, and so avoids a bunch of converting between representations for
filtering.

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




More information about the All-commits mailing list