Refactored driver so that any action that is implemented using an
ASTConsumer can also be verified using the diagnostics checker.  From
the command line, users may activate diagnostic checking using the
"-verify" option.  For example, "clang -verify -warn-dead-stores"
checks if the warnings flagged by the dead store checker match those
in the comments.

Note that we still have the option "-parse-ast-check" for backwards
comptability with existing test cases.  This option is now equivalent to 
"-parse-ast -verify".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42362 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index b921fd1..8ffd5ee 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -223,21 +223,12 @@
   return HadProblem;
 }
 
-/// CheckDiagnostics - Implement the -parse-ast-check diagnostic verifier.
-bool clang::CheckDiagnostics(Preprocessor &PP, unsigned MainFileID) {
-  // Parse the specified input file, building ASTs and performing sema, but
-  // doing nothing else.
-  return CheckASTConsumer(PP,MainFileID, 
-                          std::auto_ptr<ASTConsumer>(new ASTConsumer()));
-}
 
 /// CheckASTConsumer - Implement diagnostic checking for AST consumers.
 bool clang::CheckASTConsumer(Preprocessor &PP, unsigned MainFileID,
-                             std::auto_ptr<ASTConsumer> C) {
+                             ASTConsumer* C) {
 
-  // Local scope to auto release the consumer ...
-  { std::auto_ptr<ASTConsumer> Consumer(C);
-    ParseAST(PP, MainFileID, *Consumer.get()); }
+  ParseAST(PP, MainFileID, *C);
   
   // Gather the set of expected diagnostics.
   DiagList ExpectedErrors, ExpectedWarnings;