Skip to content

Commit 148483b

Browse files
committed
Simplify handling of classes as indirect enum elements. (NFC)
1 parent b6e360b commit 148483b

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,27 +2023,8 @@ bool SwiftLanguageRuntimeImpl::GetDynamicTypeAndAddress_IndirectEnumCase(
20232023
return false;
20242024

20252025
Flags type_info(payload_type.GetTypeInfo());
2026-
if (type_info.AllSet(eTypeIsSwift | eTypeIsClass)) {
2027-
lldb::addr_t old_box_value = box_value;
2028-
box_value = m_process.ReadPointerFromMemory(box_value, error);
2029-
if (box_value == LLDB_INVALID_ADDRESS)
2030-
return false;
2031-
2032-
DataExtractor data(&box_value, m_process.GetAddressByteSize(),
2033-
m_process.GetByteOrder(),
2034-
m_process.GetAddressByteSize());
2035-
ValueObjectSP valobj_sp(ValueObject::CreateValueObjectFromData(
2036-
"_", data, m_process, payload_type));
2037-
if (!valobj_sp)
2038-
return false;
2039-
2040-
if (!GetDynamicTypeAndAddress(*valobj_sp, use_dynamic, class_type_or_name,
2041-
address, value_type))
2042-
return false;
2043-
2044-
address.SetRawAddress(old_box_value);
2045-
return true;
2046-
} else if (type_info.AllSet(eTypeIsSwift | eTypeIsProtocol)) {
2026+
if (type_info.AllSet(eTypeIsSwift) &&
2027+
type_info.AnySet(eTypeIsClass | eTypeIsProtocol)) {
20472028
ExecutionContext exe_ctx = in_value.GetExecutionContextRef();
20482029
ValueObjectSP valobj_sp = ValueObjectMemory::Create(
20492030
exe_ctx.GetBestExecutionContextScope(), "_", box_value, payload_type);

0 commit comments

Comments
 (0)