[llvm] 0c85c48 - utils: Tweak clang-parse-diagnostics-file for modules includes
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 14:16:38 PDT 2020
Author: Duncan P. N. Exon Smith
Date: 2020-04-02T14:16:26-07:00
New Revision: 0c85c488e2b5be54ce26c9f772e66d48a9290c51
URL: https://github.com/llvm/llvm-project/commit/0c85c488e2b5be54ce26c9f772e66d48a9290c51
DIFF: https://github.com/llvm/llvm-project/commit/0c85c488e2b5be54ce26c9f772e66d48a9290c51.diff
LOG: 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
Added:
Modified:
llvm/utils/clang-parse-diagnostics-file
Removed:
################################################################################
diff --git a/llvm/utils/clang-parse-diagnostics-file b/llvm/utils/clang-parse-diagnostics-file
index 59b13f306505..1f720c34544a 100755
--- a/llvm/utils/clang-parse-diagnostics-file
+++ b/llvm/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 = '<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':
More information about the llvm-commits
mailing list