diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-24 16:24:20 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-24 16:24:20 +0000 |
| commit | 0742090e3d70475d439cc06e07e86b9254400ce1 (patch) | |
| tree | e40e9daedf8b6b8485a143404d1d0549839e6d12 /clang/lib/Serialization | |
| parent | 917fdbe35cac8fea618344c1639343f44fb97937 (diff) | |
| download | bcm5719-llvm-0742090e3d70475d439cc06e07e86b9254400ce1.tar.gz bcm5719-llvm-0742090e3d70475d439cc06e07e86b9254400ce1.zip | |
[AST] Inline CompoundStmt contents into the parent allocation.
Saves a pointer on every CompoundStmt.
llvm-svn: 321429
Diffstat (limited to 'clang/lib/Serialization')
| -rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index 8ef1491eb2d..6163b811c76 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -119,7 +119,7 @@ void ASTStmtReader::VisitCompoundStmt(CompoundStmt *S) { unsigned NumStmts = Record.readInt(); while (NumStmts--) Stmts.push_back(Record.readSubStmt()); - S->setStmts(Record.getContext(), Stmts); + S->setStmts(Stmts); S->LBraceLoc = ReadSourceLocation(); S->RBraceLoc = ReadSourceLocation(); } @@ -3081,7 +3081,8 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; case STMT_COMPOUND: - S = new (Context) CompoundStmt(Empty); + S = CompoundStmt::CreateEmpty( + Context, /*NumStmts=*/Record[ASTStmtReader::NumStmtFields]); break; case STMT_CASE: |

