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
This commit is contained in:
Duncan P. N. Exon Smith 2020-04-02 10:27:42 -07:00
parent 90455dbe2e
commit 0c85c488e2
1 changed files with 4 additions and 0 deletions

View 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 = '<module-includes>'
# 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':