Skip to content

Commit a05f062

Browse files
author
git apple-llvm automerger
committed
Merge commit '341418791a42' from swift/release/6.2 into stable/20240723
2 parents 98dd82d + 3414187 commit a05f062

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,8 @@ SwiftRuntimeTypeVisitor::VisitImpl(std::optional<unsigned> visit_only,
13821382
// TypeSystemSwiftTypeRef::GetChildCompilerTypeAtIndex can also
13831383
// handle them and without a Process.
13841384
if (!TypeSystemSwiftTypeRef::IsBuiltinType(m_type) &&
1385-
!Flags(m_type.GetTypeInfo()).AnySet(eTypeIsMetatype)) {
1385+
!Flags(m_type.GetTypeInfo()).AnySet(eTypeIsMetatype) &&
1386+
!m_type.IsFunctionType()) {
13861387
LLDB_LOG(GetLog(LLDBLog::Types),
13871388
"{0}: unrecognized builtin type info or this is a Clang type "
13881389
"without DWARF debug info",

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
#
1111
# ------------------------------------------------------------------------------
1212
"""
13-
Tests that Enum variables display correctly
13+
Tests that function variables display correctly
1414
"""
1515
import lldb
1616
from lldbsuite.test.lldbtest import *
1717
from lldbsuite.test.decorators import *
1818
import lldbsuite.test.lldbutil as lldbutil
19-
import os
2019

2120

2221
class TestFunctionVariables(TestBase):
@@ -27,11 +26,12 @@ def test_function_variables(self):
2726
target, process, thread, _ = lldbutil.run_to_source_breakpoint(
2827
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
2928

30-
self.assertGreater(thread.GetNumFrames(), 0)
31-
frame = thread.GetSelectedFrame()
29+
thin_ptr_value = self.frame().FindVariable('c')
30+
self.assertEqual(thin_ptr_value.GetNumChildren(), 0)
3231

3332
# Get the function pointer variable from our frame
34-
func_ptr_value = frame.FindVariable('func_ptr')
33+
func_ptr_value = self.frame().FindVariable('func_ptr')
34+
self.assertEqual(func_ptr_value.GetNumChildren(), 2)
3535

3636
# Grab the function pointer value as an unsigned load address
3737
func_ptr_addr = func_ptr_value.GetValueAsUnsigned()

lldb/test/API/lang/swift/variables/func/main.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
//
1111
// -----------------------------------------------------------------------------
1212
func bar() {
13-
print ("bar()")
13+
print("bar()")
1414
}
1515

16-
func main() -> Int {
16+
func main(_ c : (@convention(thin) () -> ())) {
1717
var func_ptr = bar
18-
func_ptr(); // Set breakpoint here
19-
return 0
18+
func_ptr() // Set breakpoint here
2019
}
2120

22-
main()
21+
main() {}

0 commit comments

Comments
 (0)