]> granicus.if.org Git - clang/commitdiff
When relexing the file to find expected warnings/errors, make sure
authorChris Lattner <sabre@nondot.org>
Thu, 30 Aug 2007 06:34:23 +0000 (06:34 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 30 Aug 2007 06:34:23 +0000 (06:34 +0000)
to turn off all lexer-related warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41604 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/DiagChecker.cpp

index 1e327ce363d920ba74d735f05431aea5cbd0adf4..e2efd96cce995922ed1056f51d2fee0cb62f2f25 100644 (file)
@@ -91,6 +91,13 @@ static void FindExpectedDiags(Preprocessor &PP, unsigned MainFileID,
   // Enter the cave.
   PP.EnterSourceFile(MainFileID, 0, true);
 
+  // Turn off all warnings from relexing or preprocessing.
+  PP.getDiagnostics().setWarnOnExtensions(false);
+  PP.getDiagnostics().setErrorOnExtensions(false);
+  for (unsigned i = 0; i != diag::NUM_DIAGNOSTICS; ++i)
+    if (PP.getDiagnostics().isNoteWarningOrExtension((diag::kind)i))
+      PP.getDiagnostics().setDiagnosticMapping((diag::kind)i, diag::MAP_IGNORE);
+  
   Token Tok;
   do {
     PP.Lex(Tok);