[AST] Don't store data for GNU range case statement if not needed
authorBruno Ricci <riccibrun@gmail.com>
Sun, 28 Oct 2018 12:30:53 +0000 (12:30 +0000)
committerBruno Ricci <riccibrun@gmail.com>
Sun, 28 Oct 2018 12:30:53 +0000 (12:30 +0000)
commit5b30571753cef75c86c6bc11983a5a4e56d5c771
treeee39db6bfdef844e9aef728b1b438c8af370cc6d
parent299e9b8be09f4f4228406ff7598764e3d600fba0
[AST] Don't store data for GNU range case statement if not needed

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.

Differential Revision: https://reviews.llvm.org/D53609

Reviewed By: rjmccall

llvm-svn: 345472
clang/include/clang/AST/Stmt.h
clang/lib/AST/ASTDumper.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/Stmt.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp
clang/test/Import/switch-stmt/test.cpp
clang/test/Misc/ast-dump-color.cpp