Skip to content

Commit e27eeeb

Browse files
committed
Relax overly strict cast.
LLDBTypeInfoProvider only requires a TypeSystemSwift.
1 parent 1372312 commit e27eeeb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,11 @@ bool SwiftLanguageRuntimeImpl::ForEachSuperClassType(
14851485
auto *reflection_ctx = GetReflectionContext();
14861486
if (!reflection_ctx)
14871487
return false;
1488+
CompilerType instance_type = instance.GetCompilerType();
1489+
auto *ts =
1490+
llvm::dyn_cast_or_null<TypeSystemSwift>(instance_type.GetTypeSystem());
1491+
if (!ts)
1492+
return false;
14881493

14891494
lldb::addr_t pointer = instance.GetPointerValue();
14901495
// Maybe this belongs into GetPointerValue, but on the other hand it
@@ -1494,7 +1499,7 @@ bool SwiftLanguageRuntimeImpl::ForEachSuperClassType(
14941499
// libReflection cannot tell up how many bits to strip from
14951500
// multi-payload enum values.
14961501
auto addr_deref =
1497-
FixupPointerValue(pointer, instance.GetCompilerType());
1502+
FixupPointerValue(pointer, instance_type);
14981503
pointer = addr_deref.first;
14991504
if (addr_deref.second) {
15001505
// This is a reference storage object.
@@ -1504,11 +1509,6 @@ bool SwiftLanguageRuntimeImpl::ForEachSuperClassType(
15041509
return false;
15051510
}
15061511

1507-
auto *ts = llvm::dyn_cast_or_null<TypeSystemSwiftTypeRef>(
1508-
instance.GetCompilerType().GetTypeSystem());
1509-
if (!ts)
1510-
return false;
1511-
15121512
auto md_ptr = reflection_ctx->readMetadataFromInstance(pointer);
15131513
if (!md_ptr)
15141514
return false;

0 commit comments

Comments
 (0)