From 3a5bd3107bb7cab6f74527357340a1901fc70152 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 2 Apr 2020 10:27:42 -0700 Subject: [PATCH] utils: Tweak clang-parse-diagnostics-file for modules includes Diagnostics from modules do not have a `main-file` listed. Tweak `clang-parse-diagnostics-file` to patch this up. Previously, the call to `os.path.basename` would crash. Radar-Id: rdar://problem/59000292 --- utils/clang-parse-diagnostics-file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/clang-parse-diagnostics-file b/utils/clang-parse-diagnostics-file index 59b13f30650..1f720c34544 100755 --- a/utils/clang-parse-diagnostics-file +++ b/utils/clang-parse-diagnostics-file @@ -66,6 +66,10 @@ Utility for dumping Clang-style logged diagnostics.\ for file_diags in diags: file = file_diags.get('main-file') + # Diagnostics from modules don't have a main-file listed. + if not file: + file = '' + # Ignore diagnostics for 'conftest.c', which is the file autoconf uses # for its tests (which frequently will have warnings). if os.path.basename(file) == 'conftest.c':