Index: clang-tidy/tool/run-clang-tidy.py =================================================================== --- clang-tidy/tool/run-clang-tidy.py +++ clang-tidy/tool/run-clang-tidy.py @@ -75,8 +75,8 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, - header_filter, extra_arg, extra_arg_before, quiet, - config): + vfsoverlay, header_filter, extra_arg, extra_arg_before, + quiet, config): """Gets a command line for clang-tidy.""" start = [clang_tidy_binary] if header_filter is not None: @@ -98,6 +98,8 @@ for arg in extra_arg_before: start.append('-extra-arg-before=%s' % arg) start.append('-p=' + build_path) + if vfsoverlay is not None: + start.append('-vfsoverlay=' + vfsoverlay) if quiet: start.append('-quiet') if config: @@ -158,9 +160,10 @@ while True: name = queue.get() invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, - tmpdir, build_path, args.header_filter, - args.extra_arg, args.extra_arg_before, - args.quiet, args.config) + tmpdir, build_path, args.vfsoverlay, + args.header_filter, args.extra_arg, + args.extra_arg_before, args.quiet, + args.config) sys.stdout.write(' '.join(invocation) + '\n') return_code = subprocess.call(invocation) if return_code != 0: @@ -209,6 +212,9 @@ 'code after applying fixes') parser.add_argument('-p', dest='build_path', help='Path used to read a compile command database.') + parser.add_argument('-vfsoverlay', dest='vfsoverlay', + help='Overlay the virtual filesystem described by file ' + 'over the real file system.') parser.add_argument('-extra-arg', dest='extra_arg', action='append', default=[], help='Additional argument to append to the compiler '