From a3bddeda81ca784bed5501d79e1e7c53befaa91d Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 23 Apr 2010 21:02:34 +0000 Subject: [PATCH] Destroy the inheritance path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102211 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Expr.h | 2 ++ lib/AST/Expr.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index be1246cfc5..31a421fb0e 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -1710,6 +1710,8 @@ protected: CastExpr(StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) { } + virtual void DoDestroy(ASTContext &C); + public: CastKind getCastKind() const { return Kind; } void setCastKind(CastKind K) { Kind = K; } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 036d5ef680..370f33fbf3 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -652,6 +652,13 @@ const char *CastExpr::getCastKindName() const { return 0; } +void CastExpr::DoDestroy(ASTContext &C) +{ + if (InheritancePath) + InheritancePath->Destroy(); + Expr::DoDestroy(C); +} + Expr *CastExpr::getSubExprAsWritten() { Expr *SubExpr = 0; CastExpr *E = this; -- 2.50.1