Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.

llvm-svn: 84684
diff --git a/clang/lib/Frontend/AnalysisConsumer.cpp b/clang/lib/Frontend/AnalysisConsumer.cpp
index dbf9364..55f2740 100644
--- a/clang/lib/Frontend/AnalysisConsumer.cpp
+++ b/clang/lib/Frontend/AnalysisConsumer.cpp
@@ -273,6 +273,9 @@
       !Ctx->getSourceManager().isFromMainFile(D->getLocation()))
     return;
 
+  // Clear the AnalysisManager of old AnalysisContexts.
+  Mgr->ClearContexts();
+  
   // Dispatch on the actions.
   for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I)
     (*I)(*Mgr, D);