diff options
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index cf59d1af360..b0df75b404d 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -44,6 +44,10 @@ void CXXRecordDecl::Destroy(ASTContext &C) { = Constructors.function_begin(); func != Constructors.function_end(); ++func) (*func)->Destroy(C); + + if (isDefinition()) + Destructor->Destroy(C); + RecordDecl::Destroy(C); } @@ -218,6 +222,16 @@ bool CXXConstructorDecl::isConvertingConstructor() const { (getNumParams() > 1 && getParamDecl(1)->getDefaultArg() != 0); } +CXXDestructorDecl * +CXXDestructorDecl::Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, IdentifierInfo *Id, + QualType T, bool isInline, + bool isImplicitlyDeclared) { + void *Mem = C.getAllocator().Allocate<CXXDestructorDecl>(); + return new (Mem) CXXDestructorDecl(RD, L, Id, T, isInline, + isImplicitlyDeclared); +} + CXXClassVarDecl *CXXClassVarDecl::Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, IdentifierInfo *Id, QualType T, ScopedDecl *PrevDecl) { |

