================ @@ -65,6 +65,23 @@ std::string DiagnosticManager::GetString(char separator) { return ret; } +Status DiagnosticManager::GetAsStatus(lldb::ExpressionResults result) { + llvm::SmallVector<Status::Detail, 0> details; + details.reserve(m_diagnostics.size()); + for (const auto &diagnostic : m_diagnostics) + details.push_back(diagnostic->GetDetail()); + return Status::FromExpressionErrorDetails(result, std::move(details)); +} + +void DiagnosticManager::AddDiagnostic(llvm::StringRef message, + lldb::Severity severity, + DiagnosticOrigin origin, + uint32_t compiler_id) { + m_diagnostics.emplace_back(std::make_unique<Diagnostic>( + origin, compiler_id, + Status::Detail{{}, severity, message.str(), message.str()})); ---------------- adrian-prantl wrote:
Correct. For manual LLDB-originated diagnostics the two are identical. Generally the "rendered" version is a fallback that exists if the user interface cannot render the diagnostic itself. In the case of the expression evaluator the big difference is that the rendered version repeats the expressions string inside of the diagnostic. https://github.com/llvm/llvm-project/pull/106442 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits