Skip to content

Commit 0a25acc

Browse files
Merge pull request #11589 from adrian-prantl/161435435
[LLDB] Remove fallback for Builtin.Object
2 parents 6566fab + 79fdafe commit 0a25acc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@ SwiftRuntimeTypeVisitor::VisitImpl(std::optional<unsigned> visit_only,
10931093

10941094
// Try the instance type metadata.
10951095
if (!m_valobj) {
1096+
// Static builtin types have no children.
1097+
if (ts.IsBuiltinType(m_type))
1098+
return 0;
1099+
10961100
LLDBTypeInfoProvider tip(m_runtime, ts);
10971101
auto cti_or_err = reflection_ctx->GetClassInstanceTypeInfo(
10981102
*tr, &tip, ts.GetDescriptorFinder());

lldb/test/API/lang/swift/variables/func/TestSwiftFunctionVariables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def test_function_variables(self):
3232
# Get the function pointer variable from our frame
3333
func_ptr_value = self.frame().FindVariable('func_ptr')
3434
self.assertEqual(func_ptr_value.GetNumChildren(), 2)
35+
self.assertEqual(func_ptr_value.GetChildAtIndex(0).GetNumChildren(), 0)
36+
self.assertEqual(func_ptr_value.GetChildAtIndex(1).GetNumChildren(), 0)
3537

3638
# Grab the function pointer value as an unsigned load address
3739
func_ptr_addr = func_ptr_value.GetValueAsUnsigned()
@@ -46,4 +48,3 @@ def test_function_variables(self):
4648
# Make sure the function pointer correctly resolved to our a.bar
4749
# function
4850
self.assertEqual('a.bar() -> ()', func_ptr_function.name)
49-

0 commit comments

Comments
 (0)