Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ AddRequiredAliases(Block *block, lldb::StackFrameSP &stack_frame_sp,
swift::Type first_arg_type = optional_type->getGenericArgs()[0];

// In Swift only class types can be weakly captured.
if (!llvm::isa<swift::ClassType>(first_arg_type) &&
!llvm::isa<swift::BoundGenericClassType>(first_arg_type))
if (!first_arg_type->is<swift::ClassType>() &&
!first_arg_type->is<swift::BoundGenericClassType>())
return llvm::createStringError(
"Unable to add the aliases the expression needs because "
"weakly captured type is not a class type.");
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5405,7 +5405,7 @@ bool SwiftASTContext::IsTupleType(lldb::opaque_compiler_type_t type) {
VALID_OR_RETURN(false);

auto swift_type = GetSwiftType(type);
return llvm::isa<::swift::TupleType>(swift_type);
return swift_type->is<swift::TupleType>();
}

std::optional<TypeSystemSwift::NonTriviallyManagedReferenceKind>
Expand Down Expand Up @@ -6015,8 +6015,7 @@ SwiftASTContext::GetStaticSelfType(lldb::opaque_compiler_type_t type) {
VALID_OR_RETURN_CHECK_TYPE(type, CompilerType());

swift::Type swift_type = GetSwiftType(type);
if (auto *dyn_self =
llvm::dyn_cast_or_null<swift::DynamicSelfType>(swift_type))
if (auto *dyn_self = swift_type->getAs<swift::DynamicSelfType>())
return ToCompilerType({dyn_self->getSelfType().getPointer()});
return {weak_from_this(), type};
}
Expand Down