From: Argyrios Kyrtzidis Date: Fri, 13 Jun 2008 12:15:34 +0000 (+0000) Subject: Allow -parse-noop -verify options to be used together. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14d4140de15a09d537cc96af8d5eb8c4b216032a;p=clang 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 --- 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