[clangd] Deduplicate Refs on the fly.
authorHaojian Wu <hokein@google.com>
Fri, 8 Mar 2019 09:26:30 +0000 (09:26 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 8 Mar 2019 09:26:30 +0000 (09:26 +0000)
commitf3342311768443f4e95f7e67206cbbb9f7ac8882
tree69d5296fcef3d8cb7354914af7d5dade97143156
parent8e16d73346f8091461319a7dfc4ddd18eedcff13
[clangd] Deduplicate Refs on the fly.

Summary:
Currently, we only do deduplication when we flush final results. We may
have huge duplications (refs from headers) during the indexing period (running
clangd-indexer on Chromium).

With this change, clangd-indexer can index the whole chromium projects
(48 threads, 40 GB peak memory usage).

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 355676
clang-tools-extra/clangd/index/Ref.cpp
clang-tools-extra/clangd/index/Ref.h
clang-tools-extra/clangd/indexer/IndexerMain.cpp