]> granicus.if.org Git - clang/commit
[Index] Reduce size of SymbolInfo struct.
authorSam McCall <sam.mccall@gmail.com>
Sat, 23 Dec 2017 19:31:24 +0000 (19:31 +0000)
committerSam McCall <sam.mccall@gmail.com>
Sat, 23 Dec 2017 19:31:24 +0000 (19:31 +0000)
commit48fa9ac3ec5316365b225a7dbdd5bc1d05365474
tree6d3eb79dcbaed4e3c22de2824de38cb3dad5d17e
parenta67ef1316760eb8037a5e38dd2b27fd90168e70a
[Index] Reduce size of SymbolInfo struct.

Summary:
This is currently 16 bytes, the patch reduces it to 4.
(Building with clang on linux x84, I guess others are similar)

The only subfield that might need a bigger type is SymbolPropertySet,
I've moved it to the end of the struct so if it grows, SymbolInfo will
only be 8 bytes.

With a full index of namespace-scope symbols from the LLVM project (200k)
loaded into clangd, this saves ~2MB of RAM.

Reviewers: akyrtzi

Subscribers: ilya-biryukov, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321411 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Index/IndexSymbol.h
lib/Index/IndexSymbol.cpp
tools/libclang/CXIndexDataConsumer.cpp