[all-commits] [llvm/llvm-project] 734aa1: [clangd] Publish xref for macros from Index and AST.

UTKARSH SAXENA via All-commits all-commits at lists.llvm.org
Mon Jan 13 02:11:46 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 734aa1d133f264746f721a244d2c66bc99648ee5
      https://github.com/llvm/llvm-project/commit/734aa1d133f264746f721a244d2c66bc99648ee5
  Author: Utkarsh Saxena <usx at google.com>
  Date:   2020-01-13 (Mon, 13 Jan 2020)

  Changed paths:
    M clang-tools-extra/clangd/XRefs.cpp
    M clang-tools-extra/clangd/unittests/XRefsTests.cpp

  Log Message:
  -----------
  [clangd] Publish xref for macros from Index and AST.

Summary:
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.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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




More information about the All-commits mailing list