[cfe-commits] r41604 - /cfe/trunk/Driver/DiagChecker.cpp
Chris Lattner
sabre at nondot.org
Wed Aug 29 23:34:23 PDT 2007
Author: lattner
Date: Thu Aug 30 01:34:23 2007
New Revision: 41604
URL: http://llvm.org/viewvc/llvm-project?rev=41604&view=rev
Log:
When relexing the file to find expected warnings/errors, make sure
to turn off all lexer-related warnings.
Modified:
cfe/trunk/Driver/DiagChecker.cpp
Modified: cfe/trunk/Driver/DiagChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/DiagChecker.cpp?rev=41604&r1=41603&r2=41604&view=diff
==============================================================================
--- cfe/trunk/Driver/DiagChecker.cpp (original)
+++ cfe/trunk/Driver/DiagChecker.cpp Thu Aug 30 01:34:23 2007
@@ -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);
More information about the cfe-commits
mailing list