add a new ASTConsumer consumer to simplify stuff in the driver.
Switch -parse-ast over to it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41991 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index e2efd96..3b08924 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -14,6 +14,8 @@
#include "clang.h"
#include "ASTStreamers.h"
#include "TextDiagnosticBuffer.h"
+#include "clang/Sema/ASTStreamer.h"
+#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Preprocessor.h"
using namespace clang;
@@ -223,8 +225,12 @@
/// CheckDiagnostics - Implement the -parse-ast-check diagnostic verifier.
bool clang::CheckDiagnostics(Preprocessor &PP, unsigned MainFileID) {
- // Parse the specified input file.
- BuildASTs(PP, MainFileID, false);
+ // Parse the specified input file, building ASTs and performing sema, but
+ // doing nothing else.
+{
+ ASTConsumer NullConsumer;
+ ParseAST(PP, MainFileID, NullConsumer);
+}
// Gather the set of expected diagnostics.
DiagList ExpectedErrors, ExpectedWarnings;