When relexing the file to find expected warnings/errors, make sure
to turn off all lexer-related warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41604 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index 1e327ce..e2efd96 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -91,6 +91,13 @@
   // 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);