Skip to content

Commit 97f19f3

Browse files
authored
Merge pull request #6615 from augusto2112/skip-std
[lldb] Skip importing module "std" in favor of CxxStdlib
2 parents 42faef4 + 372b44f commit 97f19f3

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8373,9 +8373,11 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
83738373
// When building the Swift stdlib with debug info these will
83748374
// show up in "Swift.o", but we already imported them and
83758375
// manually importing them will fail.
8376+
// Also skip the "std" module, as the C++ standard library will be
8377+
// imported as "CxxStdlib", which should also be imported.
83768378
if (module.path.size() &&
83778379
llvm::StringSwitch<bool>(module.path.front().GetStringRef())
8378-
.Cases("Swift", "SwiftShims", "Builtin", true)
8380+
.Cases("Swift", "SwiftShims", "Builtin", "std", true)
83798381
.Default(false))
83808382
continue;
83818383

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,37 @@ def test(self):
1919

2020
self.expect('v map', substrs=['CxxMap', 'first = 1, second = 3',
2121
'first = 2, second = 2', 'first = 3, second = 3'])
22-
23-
# This should work (rdar://106374745), check all 'expr' cases after it's fixed.
24-
self.expect('expr map', substrs=['error while processing module import: failed to '
25-
'get module "std" from AST context'], error=True)
22+
self.expect('expr map', substrs=['CxxMap', 'first = 1, second = 3',
23+
'first = 2, second = 2', 'first = 3, second = 3'])
2624

2725
self.expect('v optional', substrs=['CxxOptional', 'optional', 'Has Value=true',
2826
'Value = "In optional!"'])
27+
self.expect('expr optional', substrs=['CxxOptional', 'Has Value=true',
28+
'Value = "In optional!"'])
2929

3030
self.expect('v emptyOptional', substrs=['CxxOptional', 'emptyOptional',
3131
'Has Value=false'])
32+
self.expect('expr emptyOptional', substrs=['CxxOptional', 'Has Value=false'])
3233

3334
self.expect('v set', substrs=['CxxSet', 'size=3', '3.7', '4.2', '9.19'])
35+
self.expect('expr set', substrs=['CxxSet', 'size=3', '3.7', '4.2', '9.19'])
3436

3537
self.expect('v string', substrs=['string', 'Hello from C++!'])
38+
self.expect('expr string', substrs=['Hello from C++!'])
3639

3740
self.expect('v unorderedMap', substrs=['CxxUnorderedMap',
3841
'(first = 3, second = "three")', '(first = 2, second = "two")',
3942
'(first = 1, second = "one")'], ordered=False)
43+
self.expect('expr unorderedMap', substrs=['CxxUnorderedMap',
44+
'(first = 3, second = "three")', '(first = 2, second = "two")',
45+
'(first = 1, second = "one")'], ordered=False)
4046

4147
self.expect('v unorderedSet', substrs=['CxxUnorderedSet',
4248
'first', 'second', 'third'], ordered=False)
49+
self.expect('expr unorderedSet', substrs=['CxxUnorderedSet',
50+
'first', 'second', 'third'], ordered=False)
4351

4452
self.expect('v vector', substrs=['CxxVector', '[0] = 4.1', '[1] = 3.7',
4553
'[2] = 9.19'])
54+
self.expect('expr vector', substrs=['CxxVector', '[0] = 4.1', '[1] = 3.7',
55+
'[2] = 9.19'])

0 commit comments

Comments
 (0)