Skip to content

Commit e441845

Browse files
Merge pull request #11384 from adrian-prantl/invalid-context
[LLDB] Improve wording of error message (NFC)
2 parents a70ad9c + ac7bcb5 commit e441845

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,12 +3921,15 @@ SwiftASTContext::GetModuleImportProgressRAII(std::string category) {
39213921
category);
39223922
}
39233923

3924+
static constexpr llvm::StringLiteral g_invalid_context =
3925+
"could not initialize Swift compiler, run swift-healthcheck for more info";
3926+
39243927
llvm::Expected<swift::ModuleDecl &>
39253928
SwiftASTContext::GetModule(const SourceModule &module, bool *cached) {
39263929
if (cached)
39273930
*cached = false;
39283931

3929-
VALID_OR_RETURN(llvm::createStringError("invalid context"));
3932+
VALID_OR_RETURN(llvm::createStringError(g_invalid_context));
39303933
std::string module_name = llvm::join(module.path, ".");
39313934

39323935
LOG_PRINTF(GetLog(LLDBLog::Types), "(\"%s\")", module_name.c_str());
@@ -6584,7 +6587,7 @@ bool SwiftASTContext::IsFixedSize(CompilerType compiler_type) {
65846587
llvm::Expected<uint64_t>
65856588
SwiftASTContext::GetBitSize(opaque_compiler_type_t type,
65866589
ExecutionContextScope *exe_scope) {
6587-
VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError("invalid context"));
6590+
VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError(g_invalid_context));
65886591

65896592
// If the type has type parameters, bind them first.
65906593
swift::CanType swift_can_type(GetCanonicalSwiftType(type));
@@ -6831,7 +6834,7 @@ llvm::Expected<uint32_t>
68316834
SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
68326835
bool omit_empty_base_classes,
68336836
const ExecutionContext *exe_ctx) {
6834-
VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError("invalid type"));
6837+
VALID_OR_RETURN_CHECK_TYPE(type, llvm::createStringError(g_invalid_context));
68356838

68366839
swift::CanType swift_can_type(GetCanonicalSwiftType(type));
68376840

0 commit comments

Comments
 (0)