Skip to content

Commit 79fdafe

Browse files
committed
[LLDB] Remove fallback for Builtin.Object
rdar://161435435
1 parent e51a289 commit 79fdafe

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
@@ -1077,6 +1077,10 @@ SwiftRuntimeTypeVisitor::VisitImpl(std::optional<unsigned> visit_only,
10771077

10781078
// Try the instance type metadata.
10791079
if (!m_valobj) {
1080+
// Static builtin types have no children.
1081+
if (ts.IsBuiltinType(m_type))
1082+
return 0;
1083+
10801084
LLDBTypeInfoProvider tip(m_runtime, ts);
10811085
auto cti_or_err = reflection_ctx->GetClassInstanceTypeInfo(
10821086
*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)