summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/AST/Stmt.h2
-rw-r--r--clang/lib/AST/Stmt.cpp5
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 8b29617fa0a..c854bb56404 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -146,6 +146,8 @@ public:
DeclStmt(ScopedDecl *D, SourceLocation startLoc, SourceLocation endLoc)
: Stmt(DeclStmtClass), TheDecl(D), StartLoc(startLoc), EndLoc(endLoc) {}
+ virtual void Destroy(ASTContext& Ctx);
+
const ScopedDecl *getDecl() const { return TheDecl; }
ScopedDecl *getDecl() { return TheDecl; }
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 6ed99661355..b12518fa78c 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud