forked from OSchip/llvm-project
When destroying DeclStmts, also destroy the associated Decl (reclaim its memory).
llvm-svn: 51379
This commit is contained in:
parent
b120ff1b95
commit
512d9412ec
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue