[PATCH] D50715: [AST] Store the OwnedTagDecl as a trailing object in ElaboratedType.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 09:04:51 PDT 2018


riccibruno created this revision.
riccibruno added reviewers: rsmith, rjmccall, erichkeane.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.

The `TagDecl *OwnedTagDecl` in `ElaboratedType` is quite commonly
null (at least when parsing all of Boost, it is non-null for only about 600
of the 66k `ElaboratedType`). Therefore we can save a pointer in the
common case by storing it as a trailing object, and storing a bit in the
bit-fields of Type indicating when pointer is null.


Repository:
  rC Clang

https://reviews.llvm.org/D50715

Files:
  include/clang/AST/Type.h
  lib/AST/ASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50715.160606.patch
Type: text/x-patch
Size: 5881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180814/83af7dea/attachment.bin>


More information about the cfe-commits mailing list