@@ -3973,12 +3973,15 @@ SwiftASTContext::GetModuleImportProgressRAII(std::string category) {
3973
3973
category);
3974
3974
}
3975
3975
3976
+ static constexpr llvm::StringLiteral g_invalid_context =
3977
+ " could not initialize Swift compiler, run swift-healthcheck for more info" ;
3978
+
3976
3979
llvm::Expected<swift::ModuleDecl &>
3977
3980
SwiftASTContext::GetModule (const SourceModule &module , bool *cached) {
3978
3981
if (cached)
3979
3982
*cached = false ;
3980
3983
3981
- VALID_OR_RETURN (llvm::createStringError (" invalid context " ));
3984
+ VALID_OR_RETURN (llvm::createStringError (g_invalid_context ));
3982
3985
std::string module_name = llvm::join (module .path , " ." );
3983
3986
3984
3987
LOG_PRINTF (GetLog (LLDBLog::Types), " (\" %s\" )" , module_name.c_str ());
@@ -6639,7 +6642,7 @@ bool SwiftASTContext::IsFixedSize(CompilerType compiler_type) {
6639
6642
llvm::Expected<uint64_t >
6640
6643
SwiftASTContext::GetBitSize (opaque_compiler_type_t type,
6641
6644
ExecutionContextScope *exe_scope) {
6642
- VALID_OR_RETURN_CHECK_TYPE (type, llvm::createStringError (" invalid context " ));
6645
+ VALID_OR_RETURN_CHECK_TYPE (type, llvm::createStringError (g_invalid_context ));
6643
6646
6644
6647
// If the type has type parameters, bind them first.
6645
6648
swift::CanType swift_can_type (GetCanonicalSwiftType (type));
@@ -6886,7 +6889,7 @@ llvm::Expected<uint32_t>
6886
6889
SwiftASTContext::GetNumChildren (opaque_compiler_type_t type,
6887
6890
bool omit_empty_base_classes,
6888
6891
const ExecutionContext *exe_ctx) {
6889
- VALID_OR_RETURN_CHECK_TYPE (type, llvm::createStringError (" invalid type " ));
6892
+ VALID_OR_RETURN_CHECK_TYPE (type, llvm::createStringError (g_invalid_context ));
6890
6893
6891
6894
swift::CanType swift_can_type (GetCanonicalSwiftType (type));
6892
6895
0 commit comments