[all-commits] [llvm/llvm-project] d4021e: [Tooling/Inclusion] Add symbol mappings for `std::...

zyn0217 via All-commits all-commits at lists.llvm.org
Mon Feb 13 09:07:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4021ed3d79d8823317d894b55f4e6a30cfc3614
      https://github.com/llvm/llvm-project/commit/d4021ed3d79d8823317d894b55f4e6a30cfc3614
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
    A clang/lib/Tooling/Inclusions/Stdlib/StdTsSymbolMap.inc
    M clang/unittests/Tooling/StandardLibraryTest.cpp

  Log Message:
  -----------
  [Tooling/Inclusion] Add symbol mappings for `std::experimental::filesystem`

Clangd maintains a symbol map from standard library, in order to prevent
unexpected header/symbol leaks from internal files. (e.g. files under
`bits/` for libstdc++) This symbol map was generated by a python script
that parses pages of offline cppreference archive. The script didn't
handle the case for `std::experimental::`, where most symbols are from
TS. It works well as symbols are directly laid out in the corresponding
header under `experimental` directory for most of time.

However, libstdc++'s implementation split symbols of TS FS into a few
header files located in `experimental/bits`. This would make the code
completion provide internal headers when we simply select the symbols.

There are slightly differences between TS FS and C++17 FS. Some
functions like `system_complete` was replaced by `absolute` and
relative-related operations were introduced later by another proposal.
Even so, all mainstream implementation are based on N4100, the final
filesystem TS draft that was published in 2014 and from which symbols
we've added are exported.

This fixes https://github.com/clangd/clangd/issues/1481

Reviewed By: kadircet

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




More information about the All-commits mailing list