Fix two paste-avoidance bugs I introduced last night. Patch

by Neil Booth.  This fixes Preprocessor/output_paste_avoid.c

llvm-svn: 40454
This commit is contained in:
Chris Lattner 2007-07-23 23:21:34 +00:00
parent 6c2b393f0c
commit d63c8a5963
1 changed files with 2 additions and 2 deletions

View File

@ -426,7 +426,7 @@ bool PrintPPOutputPPCallbacks::AvoidConcat(const Token &PrevTok,
if (Tok.getKind() == tok::equal || if (Tok.getKind() == tok::equal ||
Tok.getKind() == tok::equalequal) Tok.getKind() == tok::equalequal)
return true; return true;
ConcatInfo &= ~ConcatInfo; ConcatInfo &= ~aci_avoid_equal;
} }
if (ConcatInfo == 0) return false; if (ConcatInfo == 0) return false;
@ -540,7 +540,7 @@ void clang::DoPrintPreprocessedInput(unsigned MainFileID, Preprocessor &PP,
} else if (Tok.hasLeadingSpace() || } else if (Tok.hasLeadingSpace() ||
// If we haven't emitted a token on this line yet, PrevTok isn't // If we haven't emitted a token on this line yet, PrevTok isn't
// useful to look at and no concatenation could happen anyway. // useful to look at and no concatenation could happen anyway.
(!Callbacks->hasEmittedTokensOnThisLine() && (Callbacks->hasEmittedTokensOnThisLine() &&
// Don't print "-" next to "-", it would form "--". // Don't print "-" next to "-", it would form "--".
Callbacks->AvoidConcat(PrevTok, Tok))) { Callbacks->AvoidConcat(PrevTok, Tok))) {
OutputChar(' '); OutputChar(' ');