HomePhabricator

[clangd] Use expansion location when the ref is inside macros.

Authored by hokein on Dec 9 2019, 3:00 AM.

Description

[clangd] Use expansion location when the ref is inside macros.

Summary:
Previously, xrefs has inconsistent behavior when the reference is inside
macro body:

  • AST-based xrefs (for main file) uses the expansion location;
  • our index uses the spelling location;

This patch makes our index use file locations for references, which is
consistent with AST-based xrefs, and kythe as well.

After this patch, memory usage of static index on LLVM increases ~5%.

Reviewers: ilya-biryukov

Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

Details

Committed
hokeinDec 9 2019, 7:34 AM
Differential Revision
D70480: [clangd] Use expansion location when the ref is inside macros.
Parents
rG6626e5a06a99: Fix compilation warning from GCC7. NFC.
Branches
Unknown
Tags
Unknown