to turn off all lexer-related warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41604
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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);