Skip to content

Commit 4e14288

Browse files
authored
Merge pull request #64523 from hyp/eng/libcxx-module-int
[interop][sourcekit] print submodules of CxxStdlib when printing out …
2 parents 88c28cd + 772909e commit 4e14288

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %sourcekitd-test -req=interface-gen -module CxxStdlib -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -cxx-interoperability-mode=swift-5.9 -target %target-triple -sdk %sdk | %FileCheck %s
2+
3+
// REQUIRES: OS=macosx
4+
5+
// CHECK: import CxxStdlib.vector
6+
// CHECK: extension std.basic_string<Int8, char_traits<Int8>, allocator<Int8>> {

tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
287287
ErrMsg += ModuleName;
288288
return true;
289289
}
290+
if (Mod->failedToLoad() && ModuleName == "CxxStdlib") {
291+
// We might fail to load the underlying Clang module
292+
// for a Swift overlay module like 'CxxStdlib'. Make sure an error is reported in this case, so that we can either retry to load with C++ interoperability enabled, and if that fails, we can report this to the user.
293+
ErrMsg = "Could not load underlying module for: ";
294+
ErrMsg += ModuleName;
295+
return true;
296+
}
290297

291298
PrintOptions Options = PrintOptions::printModuleInterface(
292299
Ctx.TypeCheckerOpts.PrintFullConvention);

0 commit comments

Comments
 (0)