summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch b/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch
new file mode 100644
index 0000000..500be31
--- /dev/null
+++ b/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch
@@ -0,0 +1,31 @@
1From 0dc856ed20e0fb64dd7cb0a10db35c58c3ef95e6 Mon Sep 17 00:00:00 2001
2From: Serikzhan Kazi <se7kazi@gmail.com>
3Date: Sat, 6 Nov 2021 19:53:18 +1300
4Subject: [PATCH] [clang-tidy] run-clang-tidy.py: analyze unique files only
5
6The files in compile-commands.json can potentially include duplicates.
7Change run-clang-tidy.py so that it does not run on the duplicate entries.
8
9Differential Revision: https://reviews.llvm.org/D112926
10---
11 clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
15index acd1ed6979c0..e6cff6a7414d 100755
16--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
17+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
18@@ -273,8 +273,8 @@ def main():
19
20 # Load the database and extract all files.
21 database = json.load(open(os.path.join(build_path, db_path)))
22- files = [make_absolute(entry['file'], entry['directory'])
23- for entry in database]
24+ files = set([make_absolute(entry['file'], entry['directory'])
25+ for entry in database])
26
27 max_task = args.j
28 if max_task == 0:
29--
302.34.1
31