aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-13 12:15:34 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-13 12:15:34 +0000
commit14d4140de15a09d537cc96af8d5eb8c4b216032a (patch)
treea7bd917195777d8bf811daf3a64e101790a2042d
parent1204929cf58619de7b0427c1d827588e64f38865 (diff)
Allow -parse-noop -verify options to be used together.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52249 91177308-0d34-0410-b5e6-96231b3b80d8
-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