[PATCH] D79992: [WIP][clangd] Patch PP directives to use stale preambles while building ASTs

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 03:46:04 PDT 2020


kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
kadircet retitled this revision from "[clangd] Patch PP directives to use stale preambles while building ASTs" to "[WIP][clangd] Patch PP directives to use stale preambles while building ASTs".

Depends on D79930 <https://reviews.llvm.org/D79930>.

This enables more accurate parsing of the AST, by making changes in PP
directives in preamble section visible. This is handled by injecting conditional
directives and macro defines/undefs. Note that include insertions are handled
separately in D77644 <https://reviews.llvm.org/D77644>, to not duplicate existing include headers.

This patch doesn't handle any location mappings yet, so features like go-to-def,
go-to-refs and hover might not work as expected. These will be addressed in a
follow-up patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79992

Files:
  clang-tools-extra/clangd/Preamble.cpp
  clang-tools-extra/clangd/unittests/PreambleTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79992.264196.patch
Type: text/x-patch
Size: 17329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200515/974bad7f/attachment-0001.bin>


More information about the cfe-commits mailing list