Revert "clang-format: Only output IncompleteFormat if -cursor is given."
This reverts commit r236867, as it was breaking multiple buildbots. Daniel
will look into it later.
llvm-svn: 236882
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index 5037e90..ae2180c 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -226,8 +226,7 @@
FormatStyle FormatStyle = getStyle(
Style, (FileName == "-") ? AssumeFilename : FileName, FallbackStyle);
bool IncompleteFormat = false;
- tooling::Replacements Replaces =
- reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat);
+ tooling::Replacements Replaces = reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat);
if (OutputXML) {
llvm::outs() << "<?xml version='1.0'?>\n<replacements "
"xml:space='preserve' incomplete_format='"
@@ -256,11 +255,12 @@
else if (Rewrite.overwriteChangedFiles())
return true;
} else {
+ outs() << "{";
if (Cursor.getNumOccurrences() != 0)
- outs() << "{ \"Cursor\": "
- << tooling::shiftedCodePosition(Replaces, Cursor)
- << ", \"IncompleteFormat\": "
- << (IncompleteFormat ? "true" : "false") << " }\n";
+ outs() << " \"Cursor\": "
+ << tooling::shiftedCodePosition(Replaces, Cursor) << ",";
+ outs() << " \"IncompleteFormat\": "
+ << (IncompleteFormat ? "true" : "false") << " }\n";
Rewrite.getEditBuffer(ID).write(outs());
}
}