[PATCH] D29699: [clang-tidy] Add -extra-arg and -extra-arg-before to clang-tidy-diff.py
Ehsan Akhgari via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 8 10:01:58 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL294491: [clang-tidy] Add -extra-arg and -extra-arg-before to clang-tidy-diff.py (authored by ehsan).
Changed prior to commit:
https://reviews.llvm.org/D29699?vs=87576&id=87673#toc
Repository:
rL LLVM
https://reviews.llvm.org/D29699
Files:
clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
Index: clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
===================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
+++ clang-tools-extra/trunk/clang-tidy/tool/clang-tidy-diff.py
@@ -55,6 +55,14 @@
help='checks filter, when not specified, use clang-tidy '
'default',
default='')
+ parser.add_argument('-extra-arg', dest='extra_arg',
+ action='append', default=[],
+ help='Additional argument to append to the compiler '
+ 'command line.')
+ parser.add_argument('-extra-arg-before', dest='extra_arg_before',
+ action='append', default=[],
+ help='Additional argument to prepend to the compiler '
+ 'command line.')
clang_tidy_args = []
argv = sys.argv[1:]
if '--' in argv:
@@ -113,6 +121,10 @@
if args.checks != '':
command.append('-checks=' + quote + args.checks + quote)
command.extend(lines_by_file.keys())
+ for arg in args.extra_arg:
+ command.append('-extra-arg=%s' % arg)
+ for arg in args.extra_arg_before:
+ command.append('-extra-arg-before=%s' % arg)
command.extend(clang_tidy_args)
sys.exit(subprocess.call(' '.join(command), shell=True))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29699.87673.patch
Type: text/x-patch
Size: 1368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170208/923dcb82/attachment.bin>
More information about the cfe-commits
mailing list