summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/clang-format.py
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-09-23 08:30:47 +0000
committerDaniel Jasper <djasper@google.com>2015-09-23 08:30:47 +0000
commitd89ae9d3accb4cb8b7357932c3dfba8f4ae383c4 (patch)
treeed7b06902aba907fb09f8524a1b1edbe897e69b2 /clang/tools/clang-format/clang-format.py
parent9fcf72ef9bdc047a7ab24d0fc00604cddbd5ddf5 (diff)
downloadbcm5719-llvm-d89ae9d3accb4cb8b7357932c3dfba8f4ae383c4.tar.gz
bcm5719-llvm-d89ae9d3accb4cb8b7357932c3dfba8f4ae383c4.zip
clang-format: Add initial #include sorting capabilities.
To implement this nicely, add a function that merges two sets of replacements that are meant to be done in sequence. This functionality will also be useful for other applications, e.g. formatting the result of clang-tidy fixes. llvm-svn: 248367
Diffstat (limited to 'clang/tools/clang-format/clang-format.py')
-rw-r--r--clang/tools/clang-format/clang-format.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/clang-format/clang-format.py b/clang/tools/clang-format/clang-format.py
index 5cb41fcfa37..1725e8659ad 100644
--- a/clang/tools/clang-format/clang-format.py
+++ b/clang/tools/clang-format/clang-format.py
@@ -72,7 +72,7 @@ def main():
startupinfo.wShowWindow = subprocess.SW_HIDE
# Call formatter.
- command = [binary, '-style', style, '-cursor', str(cursor)]
+ command = [binary, '-style', style, '-cursor', str(cursor), '-sort-includes']
if lines != 'all':
command.extend(['-lines', lines])
if fallback_style:
OpenPOWER on IntegriCloud