summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2008-12-17 22:30:25 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2008-12-17 22:30:25 +0000
commite013c7f6c135ee98312b6048720e83d3f26682db (patch)
treef01a1623633c56fdf05342dbfa0e50b825a915ea /clang/lib/AST
parent46f8c1290acbe34351dce28c6455185d03e508e4 (diff)
downloadbcm5719-llvm-e013c7f6c135ee98312b6048720e83d3f26682db.tar.gz
bcm5719-llvm-e013c7f6c135ee98312b6048720e83d3f26682db.zip
fix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces and ASTRecordForInterface maps
llvm-svn: 61163
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 4983d217c3e..281b2cd5de2 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -48,6 +48,33 @@ ASTContext::~ASTContext() {
Types.pop_back();
}
+ {
+ llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>::iterator
+ I = ASTRecordLayouts.begin(), E = ASTRecordLayouts.end();
+ while (I != E) {
+ ASTRecordLayout *R = const_cast<ASTRecordLayout*>((I++)->second);
+ delete R;
+ }
+ }
+
+ {
+ llvm::DenseMap<const ObjCInterfaceDecl*, const ASTRecordLayout*>::iterator
+ I = ASTObjCInterfaces.begin(), E = ASTObjCInterfaces.end();
+ while (I != E) {
+ ASTRecordLayout *R = const_cast<ASTRecordLayout*>((I++)->second);
+ delete R;
+ }
+ }
+
+ {
+ llvm::DenseMap<const ObjCInterfaceDecl*, const RecordDecl*>::iterator
+ I = ASTRecordForInterface.begin(), E = ASTRecordForInterface.end();
+ while (I != E) {
+ RecordDecl *R = const_cast<RecordDecl*>((I++)->second);
+ R->Destroy(*this);
+ }
+ }
+
TUDecl->Destroy(*this);
}
OpenPOWER on IntegriCloud