diff --git a/gnu/llvm/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/gnu/llvm/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 9e046633328..f0a1e50e62d 100644 --- a/gnu/llvm/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/gnu/llvm/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -914,7 +914,8 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, PP.Lex(Tok); continue; } else if (Tok.is(tok::annot_repl_input_end)) { - // Fall through to exit the loop. + PP.Lex(Tok); + continue; } else if (Tok.is(tok::eod)) { // Don't print end of directive tokens, since they are typically newlines // that mess up our line tracking. These come from unknown pre-processor @@ -1023,8 +1024,7 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, Callbacks->setEmittedTokensOnThisLine(); IsStartOfLine = false; - if (Tok.is(tok::eof) || Tok.is(tok::annot_repl_input_end)) - break; + if (Tok.is(tok::eof)) break; PP.Lex(Tok); // If lexing that token causes us to need to skip future tokens, do so now. @@ -1047,7 +1047,9 @@ static void DoPrintMacros(Preprocessor &PP, raw_ostream *OS) { // the macro table at the end. PP.EnterMainSourceFile(); - PP.LexTokensUntilEOF(); + Token Tok; + do PP.Lex(Tok); + while (Tok.isNot(tok::eof)); SmallVector MacrosByID; for (Preprocessor::macro_iterator I = PP.macro_begin(), E = PP.macro_end();