[PATCH] D53717: [AST] Only store the needed data in ForStmt.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 25 10:39:05 PDT 2018


riccibruno created this revision.
riccibruno added a reviewer: rjmccall.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.
riccibruno added a dependency: D53716: [AST] Only store data for the NRVO candidate in ReturnStmt if needed..

Don't store the init statement and condition variable if not needed.
This cuts the size of `ForStmt` by up to 2 pointers, and 1 pointer in
the common case. The condition and increment are stored unconditionally
since for statements without a condition and increment are quite uncommon.
The order of the children is kept the same.


Repository:
  rC Clang

https://reviews.llvm.org/D53717

Files:
  include/clang/AST/Stmt.h
  lib/AST/ASTImporter.cpp
  lib/AST/Stmt.cpp
  lib/Sema/SemaStmt.cpp
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriterStmt.cpp
  test/Import/for-stmt/test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53717.171133.patch
Type: text/x-patch
Size: 15687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181025/51ab37d4/attachment-0001.bin>


More information about the cfe-commits mailing list