[PATCH] D41514: [Index] Reduce size of SymbolInfo struct.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 14:13:32 PST 2017


sammccall created this revision.
sammccall added a reviewer: akyrtzi.
Herald added subscribers: cfe-commits, ilya-biryukov.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D41514

Files:
  include/clang/Index/IndexSymbol.h
  lib/Index/IndexSymbol.cpp
  tools/libclang/CXIndexDataConsumer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41514.127944.patch
Type: text/x-patch
Size: 9604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171221/b348fd43/attachment-0001.bin>


More information about the cfe-commits mailing list