summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-11 07:12:28 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-11 07:12:28 +0000
commitda4e0d350c00dfa40a6e443c25660f3f13f676d4 (patch)
treec67d034d45f1af3fed040b2c51374cd8221af3a4 /clang/lib/AST/ASTContext.cpp
parent6bb2463f855b0737acce40432c7d98ea517c0b7d (diff)
downloadbcm5719-llvm-da4e0d350c00dfa40a6e443c25660f3f13f676d4.tar.gz
bcm5719-llvm-da4e0d350c00dfa40a6e443c25660f3f13f676d4.zip
Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
storing the set of StoredDeclsMaps in an internal vector of void*. This isn't an ideal solution, but for the time being this fixes a major memory leak with these DenseMaps not being freed. Fixes: <rdar://problem/7634755> llvm-svn: 95861
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c92a7d14cc6..6ac989041ab 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -56,6 +56,10 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
}
ASTContext::~ASTContext() {
+ // Release the DenseMaps associated with DeclContext objects.
+ // FIXME: Is this the ideal solution?
+ ReleaseDeclContextMaps();
+
if (FreeMemory) {
// Deallocate all the types.
while (!Types.empty()) {
OpenPOWER on IntegriCloud