diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-01-10 15:19:44 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-01-10 15:19:44 +0000 |
commit | 92465285abb3ae8d3bcf359a558f6789bb9130c5 (patch) | |
tree | d1b0957993d5b1882761dcae287d47166842ef31 /clang-tools-extra | |
parent | 86c63d94bbf36d93caaead127ed1bf780e03af3f (diff) | |
download | bcm5719-llvm-92465285abb3ae8d3bcf359a558f6789bb9130c5.tar.gz bcm5719-llvm-92465285abb3ae8d3bcf359a558f6789bb9130c5.zip |
Format what you can when errors are found
llvm-svn: 172075
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/clang-format/clang-format.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-format/clang-format.py b/clang-tools-extra/clang-format/clang-format.py index 49ba74b632e..de922574070 100644 --- a/clang-tools-extra/clang-format/clang-format.py +++ b/clang-tools-extra/clang-format/clang-format.py @@ -47,13 +47,14 @@ if stderr: message = parts[2] print 'Formatting failed: %s (total %d warnings, %d errors)' % ( message, stderr.count('warning:'), stderr.count('error:')) -else: - if not stdout: - print 'Segfault occurred. Please report to bugs.llvm.org.' - elif stdout != text: - lines = stdout.split('\n') - for i in range(min(len(buf), len(lines))): - buf[i] = lines[i] - for line in lines[len(buf):]: - buf.append(line) - del buf[len(lines):] + +if not stdout: + print ('No output from clang-format (crashed?).\n' + + 'Please report to bugs.llvm.org.') +elif stdout != text: + lines = stdout.split('\n') + for i in range(min(len(buf), len(lines))): + buf[i] = lines[i] + for line in lines[len(buf):]: + buf.append(line) + del buf[len(lines):] |