Skip to content

Commit 24bff50

Browse files
committed
[lldb][cxx-interop] Populate C++ stdlib options correctly
This fixes errors printed by lldb: ``` error: module 'XYZ' was built with libc++, but current compilation uses unknown C++ stdlib ``` rdar://144894619
1 parent 5e1f334 commit 24bff50

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,8 @@ void SwiftASTContext::InitializeSearchPathOptions(
36423642
}
36433643
invocation.getSearchPathOptions().setFrameworkSearchPaths(
36443644
invocation_framework_paths);
3645+
3646+
invocation.computeCXXStdlibOptions();
36453647
}
36463648

36473649
ThreadSafeASTContext SwiftASTContext::GetASTContext() {

lldb/test/API/lang/swift/cxx_interop/forward/stl-types/TestSwiftForwardInteropSTLTypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class TestSwiftForwardInteropSTLTypes(TestBase):
1414
@swiftTest
1515
def test(self):
1616
self.build()
17+
log = self.getBuildArtifact("types.log")
18+
self.runCmd('log enable lldb types -f "%s"' % log)
1719

1820
_, _, _, _= lldbutil.run_to_source_breakpoint(
1921
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
@@ -57,3 +59,7 @@ def test(self):
5759
'[2] = 9.19'])
5860
self.expect('expr vector', substrs=['CxxVector', '[0] = 4.1', '[1] = 3.7',
5961
'[2] = 9.19'])
62+
63+
# Make sure lldb picks the correct C++ stdlib.
64+
self.filecheck('platform shell cat "%s"' % log, __file__)
65+
# CHECK-NOT: but current compilation uses unknown C++ stdlib

0 commit comments

Comments
 (0)