[Tooling] Optimize memory usage in InMemoryToolResults.
authorHaojian Wu <hokein@google.com>
Wed, 11 Apr 2018 08:13:07 +0000 (08:13 +0000)
committerHaojian Wu <hokein@google.com>
Wed, 11 Apr 2018 08:13:07 +0000 (08:13 +0000)
commit9f36c7e704ea7a604a7962452b15dc8646659744
treeb9020124ee56064658d9167de01a5968e40d14bb
parent33922a511dbb1363814428d3fa662049ee751638
[Tooling] Optimize memory usage in InMemoryToolResults.

Avoid storing duplicated "std::string"s.

clangd's global-symbol-builder takes 20+GB memory running across LLVM
repository. With this patch, the used memory is ~10GB (running on 48
threads, most of meory are AST-related).

Subscribers: klimek, cfe-commits

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

llvm-svn: 329784
clang/include/clang/Tooling/Execution.h
clang/lib/Tooling/AllTUsExecution.cpp
clang/lib/Tooling/Execution.cpp