diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 134e348619bb9..0f3bd95b6b157 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -3921,12 +3921,15 @@ SwiftASTContext::GetModuleImportProgressRAII(std::string category) { category); } +static constexpr llvm::StringLiteral g_invalid_context = + "could not initialize Swift compiler, run swift-healthcheck for more info"; + llvm::Expected SwiftASTContext::GetModule(const SourceModule &module, bool *cached) { if (cached) *cached = false; - VALID_OR_RETURN(llvm::createStringError("invalid context")); + VALID_OR_RETURN(llvm::createStringError(g_invalid_context)); std::string module_name = llvm::join(module.path, "."); LOG_PRINTF(GetLog(LLDBLog::Types), "(\"%s\")", module_name.c_str()); @@ -6584,7 +6587,7 @@ bool SwiftASTContext::IsFixedSize(CompilerType compiler_type) { llvm::Expected SwiftASTContext::GetBitSize(opaque_compiler_type_t type, ExecutionContextScope *exe_scope) { - VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError("invalid context")); + VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError(g_invalid_context)); // If the type has type parameters, bind them first. swift::CanType swift_can_type(GetCanonicalSwiftType(type)); @@ -6831,7 +6834,7 @@ llvm::Expected SwiftASTContext::GetNumChildren(opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx) { - VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError("invalid type")); + VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError(g_invalid_context)); swift::CanType swift_can_type(GetCanonicalSwiftType(type));