diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2018-11-20 16:20:40 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2018-11-20 16:20:40 +0000 |
commit | f49e1ca04d3fc2bdd7b4eaa55e70609c6172ca09 (patch) | |
tree | 84f6999b22751929ae8539b521c7f181422ffb4a /clang/lib/Serialization/ASTWriterStmt.cpp | |
parent | 855dfee2c2b4a591826d0a596425addfc9e70a93 (diff) | |
download | bcm5719-llvm-f49e1ca04d3fc2bdd7b4eaa55e70609c6172ca09.tar.gz bcm5719-llvm-f49e1ca04d3fc2bdd7b4eaa55e70609c6172ca09.zip |
[AST] Store the expressions in ParenListExpr in a trailing array
Use the newly available space in the bit-fields of Stmt
and store the expressions in a trailing array. This saves
2 pointer per ParenListExpr.
Differential Revision: https://reviews.llvm.org/D54675
Reviewed By: rjmccall
llvm-svn: 347320
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 9f861bef89d..e36b5575330 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -559,11 +559,11 @@ void ASTStmtWriter::VisitParenExpr(ParenExpr *E) { void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) { VisitExpr(E); - Record.push_back(E->NumExprs); - for (unsigned i=0; i != E->NumExprs; ++i) - Record.AddStmt(E->Exprs[i]); - Record.AddSourceLocation(E->LParenLoc); - Record.AddSourceLocation(E->RParenLoc); + Record.push_back(E->getNumExprs()); + for (auto *SubStmt : E->exprs()) + Record.AddStmt(SubStmt); + Record.AddSourceLocation(E->getLParenLoc()); + Record.AddSourceLocation(E->getRParenLoc()); Code = serialization::EXPR_PAREN_LIST; } |