[PATCH] D66751: [clangd] Add targetDecl(), which determines what declaration an AST node refers to.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 09:52:40 PDT 2019


sammccall created this revision.
sammccall added reviewers: kadircet, ilya-biryukov.
Herald added subscribers: cfe-commits, jfb, arphaman, jkorous, MaskRay, mgorny.
Herald added a project: clang.

This is the first part of an effort to "unbundle" our libIndex use into separate
concerns (AST traversal, token<->node mapping, node<->decl mapping,
decl<->decl relationshipes).

Currently, clangd relies on libIndex to associate tokens, AST nodes, and decls.
This leads to rather convoluted implementations of e.g. hover and
extract-function, which are not naturally thought of as indexing applications.

The idea is that by decoupling different concerns, we make them easier
to use, test, and combine, and more efficient when only one part is needed.
There are some synergies between e.g. traversal and finding
relationships between decls, hopefully the benefits outweight these.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66751

Files:
  clang-tools-extra/clangd/CMakeLists.txt
  clang-tools-extra/clangd/FindTarget.cpp
  clang-tools-extra/clangd/FindTarget.h
  clang-tools-extra/clangd/unittests/ASTTests.cpp
  clang-tools-extra/clangd/unittests/CMakeLists.txt
  clang-tools-extra/clangd/unittests/FindTargetTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66751.217181.patch
Type: text/x-patch
Size: 35140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190826/f5284a8d/attachment-0001.bin>


More information about the cfe-commits mailing list