aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-21 15:53:55 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-21 15:53:55 +0000
commit8e355f296a3ba45b94de49dbb18ae6a6e67df04c (patch)
tree49890bf7e8523985b59084de337a4bdea4e8aeff /lib/AST/Stmt.cpp
parent5c96c27e7f35e49a36c6ffdc55cdd5de0230f7af (diff)
When destroying DeclStmts, also destroy the associated Decl (reclaim its memory).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 6ed9966135..b12518fa78 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -55,6 +55,11 @@ void Stmt::Destroy(ASTContext& C) {
delete this;
}
+void DeclStmt::Destroy(ASTContext& C) {
+ TheDecl->Destroy(C);
+ Stmt::Destroy(C);
+}
+
void Stmt::PrintStats() {
// Ensure the table is primed.
getStmtInfoTableEntry(Stmt::NullStmtClass);