[PATCH] D53609: [AST] Don't store data for GNU range case statement if not needed.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 23 13:44:53 PDT 2018


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

Don't store the data for case statements of the form `LHS ... RHS` if not needed.
This cuts the size of `CaseStmt` by 1 pointer + 1 `SourceLocation` in
the common case.

Also use the newly available space in the bit-fields of `Stmt` to store the
keyword location of `SwitchCase` and move the small accessor
`SwitchCase::getSubStmt` to the header.


Repository:
  rC Clang

https://reviews.llvm.org/D53609

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/switch-stmt/test.cpp
  test/Misc/ast-dump-color.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53609.170740.patch
Type: text/x-patch
Size: 19275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181023/f46cccee/attachment-0001.bin>


More information about the cfe-commits mailing list