Skip to content

Commit 5bc22bf

Browse files
authored
Merge pull request #7582 from augusto2112/next-29334a7307
[lldb] Change how valobj of indirect Swift value types in C++ are ext…
2 parents 2002e0e + 7a6356a commit 5bc22bf

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,26 +1082,25 @@ SwiftLanguage::GetHardcodedSynthetics() {
10821082

10831083
casted_to_swift->SetName(ConstString("Swift_Type"));
10841084

1085-
ValueObjectSP target_valobj;
1085+
SyntheticChildrenSP synth_sp;
10861086
if (should_wrap_in_ptr) {
1087-
// If we have a pointer to a Swift value type, dereference it.
1087+
// If we have a pointer to a Swift value type, dereference the pointer
1088+
// and present those as the contents instead.
10881089
auto children = lldb_private::formatters::swift::
10891090
ExtractChildrenFromSwiftPointerValueObject(casted_to_swift);
10901091

10911092
if (children.empty())
10921093
return nullptr;
1093-
10941094
// The pointer should only have one child: the pointee.
10951095
assert(children.size() == 1 &&
10961096
"Unexpected size for pointer's children!");
1097-
target_valobj = children[0];
1097+
1098+
synth_sp = SyntheticChildrenSP(new ValueObjectWrapperSyntheticChildren(
1099+
children[0], SyntheticChildren::Flags()));
10981100
} else {
1099-
target_valobj = casted_to_swift;
1101+
synth_sp = SyntheticChildrenSP(new ValueObjectWrapperSyntheticChildren(
1102+
casted_to_swift, SyntheticChildren::Flags()));
11001103
}
1101-
1102-
SyntheticChildrenSP synth_sp =
1103-
SyntheticChildrenSP(new ValueObjectWrapperSyntheticChildren(
1104-
target_valobj, SyntheticChildren::Flags()));
11051104
return synth_sp;
11061105
});
11071106
g_formatters.push_back([](lldb_private::ValueObject &valobj,

0 commit comments

Comments
 (0)