HomePhabricator

[clangd] Using symbol name to map includes for STL symbols.

Description

[clangd] Using symbol name to map includes for STL symbols.

Summary:
Using suffix path mapping relies on the STL implementations, and it is
not portable. This patch is using symbol name mapping, which should
work with different STL implementations, fix clangd/clangd#9.

To generate the symbol mapping, we parse the cppreference symbol index
page to build a lookup table.

The mapping is not completed, a few TODOs:

  • support symbols from different headers (e.g. std::move)
  • support STL macros
  • support symbols from std's sub-namespaces (e.g. chrono)

Reviewers: ioeric, jfb, serge-sans-paille

Reviewed By: ioeric

Subscribers: sammccall, klimek, ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, kadircet, jfb, jdoerfert, cfe-commits

Tags: #clang-tools-extra, #clang

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

Details

Committed
hokeinMar 14 2019, 4:25 AM
Reviewer
ioeric
Differential Revision
D58345: [clangd] Using symbol name to map includes for STL symbols.
Parents
rL356133: Revert r356129 due to greendragon bot failures
Branches
Unknown
Tags
Unknown