1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

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 b63fb1d467
commit 3a5bd3107b

View File

@ -66,6 +66,10 @@ Utility for dumping Clang-style logged diagnostics.\
for file_diags in diags: for file_diags in diags:
file = file_diags.get('main-file') 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 # Ignore diagnostics for 'conftest.c', which is the file autoconf uses
# for its tests (which frequently will have warnings). # for its tests (which frequently will have warnings).
if os.path.basename(file) == 'conftest.c': if os.path.basename(file) == 'conftest.c':