summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/clang-format.py
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-11-02 21:27:59 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-11-02 21:27:59 +0000
commit4d195ed4b2879954190e6cbbb755eda7dd13abb9 (patch)
treef409da026f2f567f45dde4ab35f04b09b37fd348 /clang/tools/clang-format/clang-format.py
parent8bbed0b63a24ebced1a726daf47712ed6cced57d (diff)
downloadbcm5719-llvm-4d195ed4b2879954190e6cbbb755eda7dd13abb9.tar.gz
bcm5719-llvm-4d195ed4b2879954190e6cbbb755eda7dd13abb9.zip
clang-format: permit setting the path to clang in vimrc
If g:clang_format_path is set in the vimrc, that path will take precedence over the hard coded path (which is reliant on the PATH environment variable). This provides an easy mechanism for switching the selected clang-format binary during development. llvm-svn: 221108
Diffstat (limited to 'clang/tools/clang-format/clang-format.py')
-rw-r--r--clang/tools/clang-format/clang-format.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/tools/clang-format/clang-format.py b/clang/tools/clang-format/clang-format.py
index 3bb89e04b19..03493560f43 100644
--- a/clang/tools/clang-format/clang-format.py
+++ b/clang/tools/clang-format/clang-format.py
@@ -23,8 +23,11 @@ import subprocess
import sys
import vim
+# set g:clang_format_path to the path to clang-format if it is not on the path
# Change this to the full path if clang-format is not on the path.
binary = 'clang-format'
+if vim.eval('exists("g:clang_format_path")'):
+ binary = vim.eval('g:clang_format_path')
# Change this to format according to other formatting styles. See the output of
# 'clang-format --help' for a list of supported styles. The default looks for
OpenPOWER on IntegriCloud