Fix ownership model of ParseAST to allow the dtor of 
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index 4b45729..8daaa6c 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -227,8 +227,8 @@
 /// CheckASTConsumer - Implement diagnostic checking for AST consumers.
 bool clang::CheckASTConsumer(Preprocessor &PP, unsigned MainFileID,
                              ASTConsumer* C) {
-
-  ParseAST(PP, MainFileID, *C);
+  // Parse the AST and run the consumer, ultimately deleting C.
+  ParseAST(PP, MainFileID, C);
   
   // Gather the set of expected diagnostics.
   DiagList ExpectedErrors, ExpectedWarnings;