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

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 18 04:52:28 PST 2019


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a reviewer: jfb.
Herald added subscribers: jdoerfert, jfb, kadircet, arphaman, mgrang, jkorous, MaskRay, ioeric, ilya-biryukov.
Herald added a project: clang.

Using suffix path mapping relies on the STL implementations, and it is
not portable. This patch is using symbol nampe 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)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D58345

Files:
  clangd/StdSymbolMap.imp
  clangd/index/CanonicalIncludes.cpp
  clangd/index/CanonicalIncludes.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58345.187223.patch
Type: text/x-patch
Size: 69050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190218/5304b06e/attachment-0001.bin>


More information about the cfe-commits mailing list