summaryrefslogtreecommitdiffstats
path: root/tools/clang-format/ClangFormat.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-05-08 21:34:09 +0000
committerTobias Grosser <tobias@grosser.es>2015-05-08 21:34:09 +0000
commit6810d82860e0f2eaede1d32f26efe805568a836d (patch)
tree09992f95b575b32b2ed2c55f4233c103154398b1 /tools/clang-format/ClangFormat.cpp
parent3d06cfd100a164add1d0d45bef419d5ce03eb339 (diff)
Revert "Make emacs show when clang-format encountered a syntax error."
This reverts commit 236854, which caused clang-format to always print '{ "IncompleteFormat": false }' at the top of an incompletely formatted file. This output causes problems e.g. in Polly's automatic formatting checks. Daniel tried to fix this in 236867, but this fix had to be reverted due to buildbot failures. I revert this change as well for now as it is Friday night and unlikely to be fixed immediately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-format/ClangFormat.cpp')
-rw-r--r--tools/clang-format/ClangFormat.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp
index ae2180c837..fe7d678852 100644
--- a/tools/clang-format/ClangFormat.cpp
+++ b/tools/clang-format/ClangFormat.cpp
@@ -225,17 +225,14 @@ static bool format(StringRef FileName) {
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);
if (OutputXML) {
- llvm::outs() << "<?xml version='1.0'?>\n<replacements "
- "xml:space='preserve' incomplete_format='"
- << (IncompleteFormat ? "true" : "false") << "'>\n";
+ llvm::outs()
+ << "<?xml version='1.0'?>\n<replacements xml:space='preserve'>\n";
if (Cursor.getNumOccurrences() != 0)
llvm::outs() << "<cursor>"
<< tooling::shiftedCodePosition(Replaces, Cursor)
<< "</cursor>\n";
-
for (tooling::Replacements::const_iterator I = Replaces.begin(),
E = Replaces.end();
I != E; ++I) {
@@ -255,12 +252,9 @@ static bool format(StringRef FileName) {
else if (Rewrite.overwriteChangedFiles())
return true;
} else {
- outs() << "{";
if (Cursor.getNumOccurrences() != 0)
- outs() << " \"Cursor\": "
- << tooling::shiftedCodePosition(Replaces, Cursor) << ",";
- outs() << " \"IncompleteFormat\": "
- << (IncompleteFormat ? "true" : "false") << " }\n";
+ outs() << "{ \"Cursor\": "
+ << tooling::shiftedCodePosition(Replaces, Cursor) << " }\n";
Rewrite.getEditBuffer(ID).write(outs());
}
}