[clangd] Clear the semantic of RefSlab::size.
authorHaojian Wu <hokein@google.com>
Thu, 18 Oct 2018 15:33:20 +0000 (15:33 +0000)
committerHaojian Wu <hokein@google.com>
Thu, 18 Oct 2018 15:33:20 +0000 (15:33 +0000)
commit6ece6e7dad30d936d006e14bd42ca3151996e1e7
treec6b5bee6b91c7b4611a08454dacc1f101209ceac
parentc3439b099591bf86ec98c6bde0acf617a3d7b2b2
[clangd] Clear the semantic of RefSlab::size.

Summary:
The RefSlab::size can easily cause confusions, it returns the number of
different symbols, rahter than the number of all references.

- add numRefs() method and cache it, since calculating it everytime is nontrivial.
- clear misused places.

Reviewers: sammccall

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

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

llvm-svn: 344745
clang-tools-extra/clangd/index/Background.cpp
clang-tools-extra/clangd/index/FileIndex.cpp
clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/Index.h
clang-tools-extra/clangd/index/Serialization.cpp