diff options
author | Anders Carlsson <andersca@mac.com> | 2009-04-17 01:58:57 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-04-17 01:58:57 +0000 |
commit | 27ae53665f8b00fe4ba21da0fa79a4ce6e0b6cd5 (patch) | |
tree | 10a22e278b8d77f35f630084165189eeadc0fbca /lib/CodeGen/CodeGenModule.h | |
parent | ec9587d5bed6149f6df8b57192bb787c62aedb1b (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 469c637e2d..e7924fade5 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -56,6 +56,7 @@ namespace clang { class CompileOptions; class Diagnostic; class AnnotateAttr; + class CXXDestructorDecl; namespace CodeGen { @@ -240,6 +241,11 @@ public: /// 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 @@ public: 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 @@ private: /// 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); |