aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp13
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 {