aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/DiagChecker.cpp6
-rw-r--r--Driver/clang.cpp3
-rw-r--r--Driver/clang.h3
3 files changed, 11 insertions, 1 deletions
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index c060267640..643c17ee42 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -229,7 +229,11 @@ bool clang::CheckASTConsumer(Preprocessor &PP, ASTConsumer* C) {
// Parse the AST and run the consumer, ultimately deleting C.
ParseAST(PP, C);
-
+ return CheckDiagnostics(PP);
+}
+
+/// CheckDiagnostics - Gather the expected diagnostics and check them.
+bool clang::CheckDiagnostics(Preprocessor &PP) {
// Gather the set of expected diagnostics.
DiagList ExpectedErrors, ExpectedWarnings;
FindExpectedDiags(PP, ExpectedErrors, ExpectedWarnings);
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 6f7e1a256b..731c1a838b 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -1134,6 +1134,9 @@ static void ParseFile(Preprocessor &PP, MinimalAction *PA) {
// Parsing the specified input file.
P.ParseTranslationUnit();
delete PA;
+
+ if (VerifyDiagnostics)
+ exit(CheckDiagnostics(PP));
}
//===----------------------------------------------------------------------===//
diff --git a/Driver/clang.h b/Driver/clang.h
index 69434b7053..ddb5dcb11d 100644
--- a/Driver/clang.h
+++ b/Driver/clang.h
@@ -43,6 +43,9 @@ void EmitLLVMFromASTs(Preprocessor &PP, bool PrintStats);
/// CheckASTConsumer - Implement diagnostic checking for AST consumers.
bool CheckASTConsumer(Preprocessor &PP, ASTConsumer* C);
+/// CheckDiagnostics - Gather the expected diagnostics and check them.
+bool CheckDiagnostics(Preprocessor &PP);
+
} // end namespace clang