Skip to content

Commit b7ab938

Browse files
authored
[lldb] Only use Swift remark diagnostics for logging (#8371)
In `handleDiagnostics`, early exit from all Swift remarks. Remark diagnostics should not be handled as warnings/errors. At most, lldb should use remark diagnostics for logging, or progress events. By setting `EnableModuleLoadingRemarks` to true (#7857) there are remarks other than `module_loaded` that are emitted. These other remarks should be ignored in `handleDiagnostics`. rdar://121611925
1 parent 2718d94 commit b7ab938

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lldb/source/Plugins/TypeSystem/Swift/StoringDiagnosticConsumer.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,12 @@ class StoringDiagnosticConsumer : public swift::DiagnosticConsumer {
199199
std::string &s = os.str();
200200
formatted_text = !s.empty() ? std::move(s) : std::string(text);
201201
}
202-
if (info.Kind == swift::DiagnosticKind::Remark &&
203-
info.ID == swift::diag::module_loaded.ID) {
204-
// Divert module import remarks into the logs.
205-
LLDB_LOG(GetLog(LLDBLog::Types), "{0} Module import remark: {1}",
206-
m_ast_context.GetDescription(), formatted_text);
202+
if (info.Kind == swift::DiagnosticKind::Remark) {
203+
if (info.ID == swift::diag::module_loaded.ID) {
204+
// Divert module import remarks into the logs.
205+
LLDB_LOG(GetLog(LLDBLog::Types), "{0} Module import remark: {1}",
206+
m_ast_context.GetDescription(), formatted_text);
207+
}
207208
return;
208209
}
209210
RawDiagnostic diagnostic(

0 commit comments

Comments
 (0)