File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
source/Plugins/TypeSystem/Swift
test/API/lang/swift/clangimporter/clang_errorhandling Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 14
14
#define liblldb_StoringDiagnosticConsumer_h_
15
15
16
16
#include " Plugins/ExpressionParser/Swift/SwiftDiagnostic.h"
17
-
17
+ # include " Plugins/Language/Swift/LogChannelSwift.h "
18
18
#include " lldb/Utility/LLDBLog.h"
19
19
#include " lldb/Utility/StreamString.h"
20
20
@@ -216,8 +216,15 @@ class StoringDiagnosticConsumer : public swift::DiagnosticConsumer {
216
216
if (m_raw_clang_diagnostics.empty () ||
217
217
m_raw_clang_diagnostics.back () != diagnostic) {
218
218
m_raw_clang_diagnostics.push_back (std::move (diagnostic));
219
- if (info.Kind == swift::DiagnosticKind::Error)
219
+ if (info.Kind == swift::DiagnosticKind::Error) {
220
220
m_num_clang_errors++;
221
+ // Any errors from clang could be related module import
222
+ // issues which shoud be surfaced in the health log channel.
223
+ LLDB_LOG (GetLog (LLDBLog::Types), " {0} Clang error: {1}" ,
224
+ m_ast_context.GetDescription (), formatted_text);
225
+ LLDB_LOG (lldb_private::GetSwiftHealthLog (), " {0} Clang error: {1}" ,
226
+ m_ast_context.GetDescription (), formatted_text);
227
+ }
221
228
}
222
229
} else {
223
230
m_raw_swift_diagnostics.push_back (std::move (diagnostic));
Original file line number Diff line number Diff line change @@ -26,5 +26,10 @@ def test_extra_clang_flags(self):
26
26
'"-DBREAK_STUFF"' )
27
27
lldbutil .run_to_source_breakpoint (self , "break here" ,
28
28
lldb .SBFileSpec ('main.swift' ))
29
+ log = self .getBuildArtifact ("types.log" )
30
+ self .runCmd ('log enable lldb types -f "%s"' % log )
31
+
29
32
self .expect ("expr 0" , error = True ,
30
33
substrs = ['failed to import bridging header' ])
34
+ self .filecheck ('platform shell cat "%s"' % log , __file__ )
35
+ # CHECK: Clang error: {{.*}}bridging-header.h
You can’t perform that action at this time.
0 commit comments