Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3921,12 +3921,15 @@ SwiftASTContext::GetModuleImportProgressRAII(std::string category) {
category);
}

static const char *g_invalid_context =
"could not initialize Swift compiler, run swift-healthcheck for more info";

llvm::Expected<swift::ModuleDecl &>
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());
Expand Down Expand Up @@ -6584,7 +6587,7 @@ bool SwiftASTContext::IsFixedSize(CompilerType compiler_type) {
llvm::Expected<uint64_t>
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));
Expand Down Expand Up @@ -6831,7 +6834,7 @@ llvm::Expected<uint32_t>
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));

Expand Down