diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-21 16:38:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-21 16:38:54 +0000 |
commit | 4b05b1dee6cc65ae61d93dab7edff72710f24589 (patch) | |
tree | 5b692f816ef7be895c1302a5d850cc23a64f7345 /lib/AST/Type.cpp | |
parent | 936ff132a9aba1f1bb5d72a5744da1e10ce269d2 (diff) |
Add Destroy method to Types, making there destruction more harmonious with
the destruction of Decls and Stmts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 741d59bc76..e561a1074c 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -22,7 +22,18 @@ #include <sstream> using namespace clang; -Type::~Type() {} +void Type::Destroy(ASTContext& C) { delete this; } + +void FunctionTypeProto::Destroy(ASTContext& C) { + // Destroy the object, but don't call delete. These are malloc'd. + this->~FunctionTypeProto(); + free(this); +} + +void VariableArrayType::Destroy(ASTContext& C) { + SizeExpr->Destroy(C); + delete this; +} /// isVoidType - Helper method to determine if this is the 'void' type. bool Type::isVoidType() const { |