Skip to content

Commit 798fbdf

Browse files
authored
Merge pull request llvm#11911 from swiftlang/jepa-release2
[swift/release/6.3][lldb] Swift: Fix `swift::Type` casts for swiftlang/swift#85487
2 parents 6af3568 + 95fec0a commit 798fbdf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,8 @@ AddRequiredAliases(Block *block, lldb::StackFrameSP &stack_frame_sp,
687687
swift::Type first_arg_type = optional_type->getGenericArgs()[0];
688688

689689
// In Swift only class types can be weakly captured.
690-
if (!llvm::isa<swift::ClassType>(first_arg_type) &&
691-
!llvm::isa<swift::BoundGenericClassType>(first_arg_type))
690+
if (!first_arg_type->is<swift::ClassType>() &&
691+
!first_arg_type->is<swift::BoundGenericClassType>())
692692
return llvm::createStringError(
693693
"Unable to add the aliases the expression needs because "
694694
"weakly captured type is not a class type.");

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5452,7 +5452,7 @@ bool SwiftASTContext::IsTupleType(lldb::opaque_compiler_type_t type) {
54525452
VALID_OR_RETURN(false);
54535453

54545454
auto swift_type = GetSwiftType(type);
5455-
return llvm::isa<::swift::TupleType>(swift_type);
5455+
return swift_type->is<swift::TupleType>();
54565456
}
54575457

54585458
std::optional<TypeSystemSwift::NonTriviallyManagedReferenceKind>
@@ -6062,8 +6062,7 @@ SwiftASTContext::GetStaticSelfType(lldb::opaque_compiler_type_t type) {
60626062
VALID_OR_RETURN_CHECK_TYPE(type, CompilerType());
60636063

60646064
swift::Type swift_type = GetSwiftType(type);
6065-
if (auto *dyn_self =
6066-
llvm::dyn_cast_or_null<swift::DynamicSelfType>(swift_type))
6065+
if (auto *dyn_self = swift_type->getAs<swift::DynamicSelfType>())
60676066
return ToCompilerType({dyn_self->getSelfType().getPointer()});
60686067
return {weak_from_this(), type};
60696068
}

0 commit comments

Comments
 (0)