Allow -parse-noop -verify options to be used together.

llvm-svn: 52249
This commit is contained in:
Argyrios Kyrtzidis 2008-06-13 12:15:34 +00:00
parent ed169d531d
commit 351008da17
3 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -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));
}
//===----------------------------------------------------------------------===//

View File

@ -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