[PATCH] D54166: [AST] Store the string data in StringLiteral in a trailing array of chars

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 14 15:23:29 PST 2018


riccibruno marked 2 inline comments as done.
riccibruno added a comment.

In https://reviews.llvm.org/D54166#1298889, @rjmccall wrote:

> IIRC, abbreviations just silently don't take effect if the record doesn't conform; so things will appear to work, but the size on disk will be bigger.


I looked at where the abbreviations are defined, and it seems that the only abbreviations for
statements/expressions are for `DeclRefExpr`, `IntegerLiteral`, `CharacterLiteral`
and `ImplicitCastExpr` (grep for `EmitAbbrev` in `Serialization/`,
for some reasons they are emitted in `WriteDeclAbbrev()`...).

And indeed changing the serialization format of `CharacterLiteral` triggers various assertions
because of the abbreviation. Therefore unless I am missing something no other statement/expression
has currently an abbreviation. I suspect therefore that someone could go wild and cut the on-disk
size of the serialization format significantly here.

I looked at the size of the generated pch for all of Boost, and I am only seeing an increase of
about 8k, which is entirely attributable to the fact that I am adding one field to the serialization
format. I can rework it to remove this additional field if needed.


Repository:
  rC Clang

https://reviews.llvm.org/D54166





More information about the cfe-commits mailing list