diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-08-12 02:28:50 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-08-12 02:28:50 +0000 |
commit | 888376a2bbcfc2f047902249f8455918e2489ae1 (patch) | |
tree | eb5a20362253f77bb48bf394f6fff7925b1b2047 /lib/AST/Expr.cpp | |
parent | e96de2dfde487211fb52f9139cdcae64d051a406 (diff) |
Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index ce8bb516c0..cfcbca4730 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1596,13 +1596,20 @@ bool ChooseExpr::isConditionTrue(ASTContext &C) const { return getCond()->EvaluateAsInt(C) != 0; } -void ShuffleVectorExpr::setExprs(Expr ** Exprs, unsigned NumExprs) { - if (NumExprs) - delete [] SubExprs; - - SubExprs = new Stmt* [NumExprs]; +void ShuffleVectorExpr::setExprs(ASTContext &C, Expr ** Exprs, + unsigned NumExprs) { + if (SubExprs) C.Deallocate(SubExprs); + + SubExprs = new (C) Stmt* [NumExprs]; this->NumExprs = NumExprs; memcpy(SubExprs, Exprs, sizeof(Expr *) * NumExprs); +} + +void ShuffleVectorExpr::DoDestroy(ASTContext& C) { + DestroyChildren(C); + if (SubExprs) C.Deallocate(SubExprs); + this->~ShuffleVectorExpr(); + C.Deallocate(this); } void SizeOfAlignOfExpr::DoDestroy(ASTContext& C) { |