Skip to content

Commit 120c7de

Browse files
committed
[ClangImporter] Fix CxxStdlib submodule names in swift interface
A previous commit resulted in the swift interface for CxxStdlib containing an `import CxxStdlib` for each submodule. This restores the submodule names to `CxxStdlib.vector` etc.
1 parent 406cc1d commit 120c7de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8770,11 +8770,12 @@ bool importer::isCxxStdModule(StringRef moduleName, bool IsSystem) {
87708770
}
87718771

87728772
ImportPath::Builder importer::getSwiftModulePath(ASTContext &SwiftContext, const clang::Module *M) {
8773-
if (isCxxStdModule(M))
8774-
return ImportPath::Builder(SwiftContext.Id_CxxStdlib);
87758773
ImportPath::Builder builder;
87768774
while (M) {
8777-
builder.push_back(SwiftContext.getIdentifier(M->Name));
8775+
if (!M->isSubModule() && isCxxStdModule(M))
8776+
builder.push_back(SwiftContext.Id_CxxStdlib);
8777+
else
8778+
builder.push_back(SwiftContext.getIdentifier(M->Name));
87788779
M = M->Parent;
87798780
}
87808781
std::reverse(builder.begin(), builder.end());

0 commit comments

Comments
 (0)