summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 3165ad065b2..923aab291db 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -29,13 +29,7 @@ enum FloatingRank {
ASTContext::~ASTContext() {
// Deallocate all the types.
while (!Types.empty()) {
- if (FunctionTypeProto *FT = dyn_cast<FunctionTypeProto>(Types.back())) {
- // Destroy the object, but don't call delete. These are malloc'd.
- FT->~FunctionTypeProto();
- free(FT);
- } else {
- delete Types.back();
- }
+ Types.back()->Destroy(*this);
Types.pop_back();
}
}
OpenPOWER on IntegriCloud