[PATCH] D56134: [AST] Store some data of CXXNewExpr as trailing objects

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 28 11:25:51 PST 2018


riccibruno created this revision.
riccibruno added a reviewer: rjmccall.
riccibruno added a project: clang.
Herald added a reviewer: shafik.
Herald added a subscriber: cfe-commits.

Store the optional array size expression, optional initialization expression and optional
placement new arguments in a trailing array. Additionally store the range for the parenthesized
type-id in a trailing object if needed since in the vast majority of cases the type is not parenthesized
(not a single new expression in the translation unit of `SemaDecl.cpp` has a parenthesized type-id).

This saves 2 pointers per `CXXNewExpr` in all cases, and 2 pointers + 8 bytes per `CXXNewExpr`
in the common case where the type is not parenthesized.


Repository:
  rC Clang

https://reviews.llvm.org/D56134

Files:
  include/clang/AST/ExprCXX.h
  include/clang/AST/Stmt.h
  lib/AST/ASTImporter.cpp
  lib/AST/ExprCXX.cpp
  lib/CodeGen/CGExprCXX.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriterStmt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56134.179639.patch
Type: text/x-patch
Size: 28431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181228/f5a4d4f1/attachment-0001.bin>


More information about the cfe-commits mailing list