From d63c8a59639ceda754f25f54dabd73d144fbb035 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 23 Jul 2007 23:21:34 +0000 Subject: [PATCH] Fix two paste-avoidance bugs I introduced last night. Patch by Neil Booth. This fixes Preprocessor/output_paste_avoid.c llvm-svn: 40454 --- clang/Driver/PrintPreprocessedOutput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/Driver/PrintPreprocessedOutput.cpp b/clang/Driver/PrintPreprocessedOutput.cpp index 87180f455e81..d5c5b9a08bb3 100644 --- a/clang/Driver/PrintPreprocessedOutput.cpp +++ b/clang/Driver/PrintPreprocessedOutput.cpp @@ -426,7 +426,7 @@ bool PrintPPOutputPPCallbacks::AvoidConcat(const Token &PrevTok, if (Tok.getKind() == tok::equal || Tok.getKind() == tok::equalequal) return true; - ConcatInfo &= ~ConcatInfo; + ConcatInfo &= ~aci_avoid_equal; } if (ConcatInfo == 0) return false; @@ -540,7 +540,7 @@ void clang::DoPrintPreprocessedInput(unsigned MainFileID, Preprocessor &PP, } else if (Tok.hasLeadingSpace() || // If we haven't emitted a token on this line yet, PrevTok isn't // useful to look at and no concatenation could happen anyway. - (!Callbacks->hasEmittedTokensOnThisLine() && + (Callbacks->hasEmittedTokensOnThisLine() && // Don't print "-" next to "-", it would form "--". Callbacks->AvoidConcat(PrevTok, Tok))) { OutputChar(' ');