diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-12-23 19:31:24 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-12-23 19:31:24 +0000 |
commit | 48fa9ac3ec5316365b225a7dbdd5bc1d05365474 (patch) | |
tree | 6d3eb79dcbaed4e3c22de2824de38cb3dad5d17e /tools | |
parent | a67ef1316760eb8037a5e38dd2b27fd90168e70a (diff) |
[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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CXIndexDataConsumer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libclang/CXIndexDataConsumer.cpp b/tools/libclang/CXIndexDataConsumer.cpp index ffe5c486dd..89ac23be73 100644 --- a/tools/libclang/CXIndexDataConsumer.cpp +++ b/tools/libclang/CXIndexDataConsumer.cpp @@ -1304,11 +1304,11 @@ static CXIdxEntityKind getEntityKindFromSymbolKind(SymbolKind K, SymbolLanguage static CXIdxEntityCXXTemplateKind getEntityKindFromSymbolProperties(SymbolPropertySet K) { - if (K & (unsigned)SymbolProperty::TemplatePartialSpecialization) + if (K & (SymbolPropertySet)SymbolProperty::TemplatePartialSpecialization) return CXIdxEntity_TemplatePartialSpecialization; - if (K & (unsigned)SymbolProperty::TemplateSpecialization) + if (K & (SymbolPropertySet)SymbolProperty::TemplateSpecialization) return CXIdxEntity_TemplateSpecialization; - if (K & (unsigned)SymbolProperty::Generic) + if (K & (SymbolPropertySet)SymbolProperty::Generic) return CXIdxEntity_Template; return CXIdxEntity_NonTemplate; } |