Add support for generating (very basic) C++ destructors. These aren't called by anything yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69343 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 469c637..e7924fa 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -56,6 +56,7 @@
   class CompileOptions;
   class Diagnostic;
   class AnnotateAttr;
+  class CXXDestructorDecl;
 
 namespace CodeGen {
 
@@ -240,6 +241,11 @@
   /// given type.
   llvm::Function *GetAddrOfCXXConstructor(const CXXConstructorDecl *D, 
                                           CXXCtorType Type);
+
+  /// GetAddrOfCXXDestructor - Return the address of the constructor of the
+  /// given type.
+  llvm::Function *GetAddrOfCXXDestructor(const CXXDestructorDecl *D, 
+                                         CXXDtorType Type);
   
   /// getBuiltinLibFunction - Given a builtin id for a function like
   /// "__builtin_fabsf", return a Function* for "fabsf".
@@ -331,6 +337,8 @@
   const char *getMangledName(const NamedDecl *ND);
   const char *getMangledCXXCtorName(const CXXConstructorDecl *D, 
                                     CXXCtorType Type);
+  const char *getMangledCXXDtorName(const CXXDestructorDecl *D, 
+                                    CXXDtorType Type);
   
   enum GVALinkage {
     GVA_Internal,
@@ -392,6 +400,14 @@
   /// a C++ constructor Decl.
   void EmitCXXConstructor(const CXXConstructorDecl *D, CXXCtorType Type);
   
+  /// EmitCXXDestructors - Emit destructors (base, complete) from a 
+  /// C++ destructor Decl.
+  void EmitCXXDestructors(const CXXDestructorDecl *D);
+  
+  /// EmitCXXDestructor - Emit a single destructor with the given type from
+  /// a C++ destructor Decl.
+  void EmitCXXDestructor(const CXXDestructorDecl *D, CXXDtorType Type);
+  
   // FIXME: Hardcoding priority here is gross.
   void AddGlobalCtor(llvm::Function * Ctor, int Priority=65535);
   void AddGlobalDtor(llvm::Function * Dtor, int Priority=65535);