diff options
Diffstat (limited to 'lib/Format')
-rw-r--r-- | lib/Format/Format.cpp | 7 | ||||
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 299a8558b9..a78b650dfa 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -804,9 +804,10 @@ public: // Consume and record whitespace until we find a significant token. while (FormatTok.Tok.is(tok::unknown)) { - FormatTok.NewlinesBefore += Text.count('\n'); - FormatTok.HasUnescapedNewline = - Text.count("\\\n") != FormatTok.NewlinesBefore; + unsigned Newlines = Text.count('\n'); + unsigned EscapedNewlines = Text.count("\\\n"); + FormatTok.NewlinesBefore += Newlines; + FormatTok.HasUnescapedNewline |= EscapedNewlines != Newlines; FormatTok.WhiteSpaceLength += FormatTok.Tok.getLength(); if (FormatTok.Tok.is(tok::eof)) diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index cb956084e0..3030789ad0 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -766,7 +766,8 @@ void UnwrappedLineParser::addUnwrappedLine() { if (Line->Tokens.empty()) return; DEBUG({ - llvm::dbgs() << "Line(" << Line->Level << "): "; + llvm::dbgs() << "Line(" << Line->Level << ")" + << (Line->InPPDirective ? " MACRO" : "") << ": "; for (std::list<FormatToken>::iterator I = Line->Tokens.begin(), E = Line->Tokens.end(); I != E; ++I) { |