[PATCH] D20469: [include-fixer] Don't run the script if clang-include-fixer binary is not valid.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 06:20:53 PDT 2016

hokein created this revision.
hokein added a reviewer: ioeric.
hokein added subscribers: bkramer, cfe-commits.

Also show a better error message.



Index: include-fixer/tool/clang-include-fixer.py
--- include-fixer/tool/clang-include-fixer.py
+++ include-fixer/tool/clang-include-fixer.py
@@ -37,6 +37,14 @@
                       help='String to initialize the database.')
   args = parser.parse_args()
+  # Check whether the path of clang-include-fixer binary is valid.
+  try:
+    invocation = [binary, '-help']
+    subprocess.check_output(invocation)
+  except:
+    print >>sys.stderr, "Unable to find clang-include-fixer binary."
+    return
   # Get the current text.
   buf = vim.current.buffer
   text = '\n'.join(buf)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20469.57928.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160520/b1521b88/attachment.bin>

More information about the cfe-commits mailing list