[PATCH] D72395: [clangd] Publish xref for macros from Index and AST.

UTKARSH SAXENA via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 05:23:06 PST 2020


usaxena95 created this revision.
usaxena95 added a reviewer: kadircet.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

With this patch the `findReferences` API will return Xref for macros.
If the symbol under the cursor is a macro then we collect the references to it from:

1. Main file by looking at the ParsedAST. (These were added to the ParsedAST in https://reviews.llvm.org/D70008)
2. Files other than the mainfile by looking at the:
  - static index (Added in https://reviews.llvm.org/D70489)
  - file index (Added in https://reviews.llvm.org/D71406)

This patch collects all the xref from the above places and outputs it in `findReferences` API.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72395

Files:
  clang-tools-extra/clangd/XRefs.cpp
  clang-tools-extra/clangd/unittests/XRefsTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72395.236799.patch
Type: text/x-patch
Size: 6232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200108/3706a2b6/attachment-0001.bin>


More information about the cfe-commits mailing list