[all-commits] [llvm/llvm-project] ecaa4d: [clangd] Indexing of standard library

Sam McCall via All-commits all-commits at lists.llvm.org
Tue May 17 07:51:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ecaa4d9662c9a6ac013ac40a8ad72a2c75e3fd3b
      https://github.com/llvm/llvm-project/commit/ecaa4d9662c9a6ac013ac40a8ad72a2c75e3fd3b
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-05-17 (Tue, 17 May 2022)

  Changed paths:
    M clang-tools-extra/clangd/CMakeLists.txt
    M clang-tools-extra/clangd/ClangdServer.cpp
    M clang-tools-extra/clangd/ClangdServer.h
    M clang-tools-extra/clangd/Config.h
    M clang-tools-extra/clangd/ConfigCompile.cpp
    M clang-tools-extra/clangd/ConfigFragment.h
    M clang-tools-extra/clangd/ConfigYAML.cpp
    M clang-tools-extra/clangd/TUScheduler.cpp
    M clang-tools-extra/clangd/TUScheduler.h
    M clang-tools-extra/clangd/index/FileIndex.cpp
    M clang-tools-extra/clangd/index/FileIndex.h
    A clang-tools-extra/clangd/index/StdLib.cpp
    A clang-tools-extra/clangd/index/StdLib.h
    M clang-tools-extra/clangd/index/SymbolOrigin.cpp
    M clang-tools-extra/clangd/index/SymbolOrigin.h
    M clang-tools-extra/clangd/unittests/CMakeLists.txt
    A clang-tools-extra/clangd/unittests/StdLibTests.cpp
    M clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp

  Log Message:
  -----------
  [clangd] Indexing of standard library

This provides a nice "warm start" with all headers indexed, not just
those included so far.

The standard library is indexed after a preamble is parsed, using that
file's configuration. The result is pushed into the dynamic index.
If we later see a higher language version, we reindex it.

It's configurable as Index.StandardLibrary, off by default for now.

Based on D105177 by @kuhnel

Fixes https://github.com/clangd/clangd/issues/618

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




More information about the All-commits mailing list