[cfe-commits] [clang-tools-extra] r172075 - /clang-tools-extra/trunk/clang-format/clang-format.py

Alexander Kornienko alexfh at google.com
Thu Jan 10 07:19:44 PST 2013


Author: alexfh
Date: Thu Jan 10 09:19:44 2013
New Revision: 172075

URL: http://llvm.org/viewvc/llvm-project?rev=172075&view=rev
Log:
Format what you can when errors are found

Modified:
    clang-tools-extra/trunk/clang-format/clang-format.py

Modified: clang-tools-extra/trunk/clang-format/clang-format.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format.py?rev=172075&r1=172074&r2=172075&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-format/clang-format.py (original)
+++ clang-tools-extra/trunk/clang-format/clang-format.py Thu Jan 10 09:19:44 2013
@@ -47,13 +47,14 @@
     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):]





More information about the cfe-commits mailing list