diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-07 06:08:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-07 06:08:38 +0000 |
commit | 42602bb40aefcc2751d4078ba88aacf4d965c9bd (patch) | |
tree | f06466787a5ac3936997adfcedd9fcd3d711a30f /lib/AST/Stmt.cpp | |
parent | ef888a4d7f0fa1596807f702d09df88044dcaf41 (diff) |
Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 17577910d2..668f7ef57f 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -51,19 +51,12 @@ void Stmt::DestroyChildren(ASTContext &C) { if (Stmt* Child = *I++) Child->Destroy(C); } -void Stmt::Destroy(ASTContext &C) { +void Stmt::DoDestroy(ASTContext &C) { DestroyChildren(C); - // FIXME: Eventually all Stmts should be allocated with the allocator - // in ASTContext, just like with Decls. this->~Stmt(); C.Deallocate((void *)this); } -void DeclStmt::Destroy(ASTContext &C) { - this->~DeclStmt(); - C.Deallocate((void *)this); -} - void Stmt::PrintStats() { // Ensure the table is primed. getStmtInfoTableEntry(Stmt::NullStmtClass); @@ -569,10 +562,10 @@ QualType CXXCatchStmt::getCaughtType() { return QualType(); } -void CXXCatchStmt::Destroy(ASTContext& C) { +void CXXCatchStmt::DoDestroy(ASTContext& C) { if (ExceptionDecl) ExceptionDecl->Destroy(C); - Stmt::Destroy(C); + Stmt::DoDestroy(C); } // CXXTryStmt |