[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)
commite83ae11ccc928ae29c1987655459d17bca000f26
treee22bf5b63c061251b091d9f249c0870a3c7cab58
parentd9548c350f8f1c88d8c203a1ca2acbdfefc18cb9
[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

llvm-svn: 321411
clang/include/clang/Index/IndexSymbol.h
clang/lib/Index/IndexSymbol.cpp
clang/tools/libclang/CXIndexDataConsumer.cpp