[clangd] Add a flag for spelled references in the Index
authorKirill Bobyrev <kbobyrev@google.com>
Thu, 6 Feb 2020 07:18:14 +0000 (08:18 +0100)
committerKirill Bobyrev <kbobyrev@google.com>
Thu, 6 Feb 2020 07:18:14 +0000 (08:18 +0100)
commita6860c1af45776e349eaed3e8f0bb7e97abccd89
tree06649a0d2cd2d1edc8ce41253b85cd22b6b22b93
parent3da7dcf38a96b7ba8ba0cb61be40210ace3fd91f
[clangd] Add a flag for spelled references in the Index

This patch allows the index does to provide a way to distinguish
implicit references (e.g. coming from macro expansions) from the spelled
ones. The corresponding flag was added to RefKind and symbols that are
referenced without spelling their name explicitly are now marked
implicit. This allows fixing incorrect behavior when renaming a symbol
that was referenced in macro expansions would try to rename macro
invocations.

Differential Revision: D72746

Reviewed by: hokein
clang-tools-extra/clangd/index/Ref.h
clang-tools-extra/clangd/index/SymbolCollector.cpp
clang-tools-extra/clangd/unittests/RenameTests.cpp
clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp