aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp7
1 files changed, 4 insertions, 3 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))