Parsing, representation, and preliminary semantic analysis of destructors.

Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58767 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index cf59d1a..b0df75b 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -44,6 +44,10 @@
          = Constructors.function_begin();
        func != Constructors.function_end(); ++func)
     (*func)->Destroy(C);
+
+  if (isDefinition())
+    Destructor->Destroy(C);
+
   RecordDecl::Destroy(C);
 }
 
@@ -218,6 +222,16 @@
          (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) {