summaryrefslogtreecommitdiff
path: root/lib/Format/UnwrappedLineFormatter.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:09 +0000
commitf0c55418e2b09eaab37c820d3756cc1b4584d084 (patch)
tree9263bf60f263bb5a7aaa4d2c1be43e5fc4d942e0 /lib/Format/UnwrappedLineFormatter.cpp
parent583e75cce441388bc562fa225d23499261a0091e (diff)
Notes
Diffstat (limited to 'lib/Format/UnwrappedLineFormatter.cpp')
-rw-r--r--lib/Format/UnwrappedLineFormatter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Format/UnwrappedLineFormatter.cpp b/lib/Format/UnwrappedLineFormatter.cpp
index c3c154afeb8a3..8ff893426e255 100644
--- a/lib/Format/UnwrappedLineFormatter.cpp
+++ b/lib/Format/UnwrappedLineFormatter.cpp
@@ -835,8 +835,11 @@ UnwrappedLineFormatter::format(const SmallVectorImpl<AnnotatedLine *> &Lines,
bool ShouldFormat = TheLine.Affected || FixIndentation;
// We cannot format this line; if the reason is that the line had a
// parsing error, remember that.
- if (ShouldFormat && TheLine.Type == LT_Invalid && IncompleteFormat)
- *IncompleteFormat = true;
+ if (ShouldFormat && TheLine.Type == LT_Invalid && Status) {
+ Status->FormatComplete = false;
+ Status->Line =
+ SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation());
+ }
if (ShouldFormat && TheLine.Type != LT_Invalid) {
if (!DryRun)