]> granicus.if.org Git - clang/commitdiff
Allow -parse-noop -verify options to be used together.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 13 Jun 2008 12:15:34 +0000 (12:15 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 13 Jun 2008 12:15:34 +0000 (12:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52249 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/DiagChecker.cpp
Driver/clang.cpp
Driver/clang.h

index c06026764033e5ceead89df17c1f413563ec8d89..643c17ee4296ed5f0a51539e15afc4846f1f7cf2 100644 (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);
index 6f7e1a256b1450ea7b0726bb6f1b1857bb178b66..731c1a838b1176c0ee0b7281f42c0ef941ad31f0 100644 (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));
 }
 
 //===----------------------------------------------------------------------===//
index 69434b7053505763dd92f075b592845f18209b04..ddb5dcb11d8f5af289ed362e0996e62e27108057 100644 (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