aboutsummaryrefslogtreecommitdiff
path: root/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
commit3478eb6872d836600caf45b0f81c2065d685d6e0 (patch)
treec5498e2183ab3d990c96e9971a7c77b129d045f7 /lib/AST/ASTContext.cpp
parent3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 (diff)
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c92a7d14cc..6ac989041a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/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()) {