Skip to content

[interop][sourcekit] print submodules of CxxStdlib when printing out … #64523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// 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

// REQUIRES: OS=macosx

// CHECK: import CxxStdlib.vector
// CHECK: extension std.basic_string<Int8, char_traits<Int8>, allocator<Int8>> {
7 changes: 7 additions & 0 deletions tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
ErrMsg += ModuleName;
return true;
}
if (Mod->failedToLoad() && ModuleName == "CxxStdlib") {
// We might fail to load the underlying Clang module
// 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.
ErrMsg = "Could not load underlying module for: ";
ErrMsg += ModuleName;
return true;
}

PrintOptions Options = PrintOptions::printModuleInterface(
Ctx.TypeCheckerOpts.PrintFullConvention);
Expand Down