mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ClangImporter] Add clang module imports to Swift wrapper module
When macros like _SwiftifyImport are added to a wrapper module for a clang module, they may need to refer to symbols declared in another clang module that the wrapped module imports (e.g. because they are used in the original signature). This adds all the imported clang modules as implicit imports to the wrapper module. rdar://151611573
This commit is contained in:
@@ -321,15 +321,14 @@ void swift::performImportResolution(SourceFile &SF) {
|
||||
verify(SF);
|
||||
}
|
||||
|
||||
void swift::performImportResolutionForClangMacroBuffer(
|
||||
SourceFile &SF, ModuleDecl *clangModule
|
||||
) {
|
||||
void swift::performImportResolutionForClangMacroBuffer(SourceFile &SF) {
|
||||
// If we've already performed import resolution, bail.
|
||||
if (SF.ASTStage == SourceFile::ImportsResolved)
|
||||
return;
|
||||
|
||||
// `getWrapperForModule` has already declared all the implicit clang module
|
||||
// imports we need
|
||||
ImportResolver resolver(SF);
|
||||
resolver.addImplicitImport(clangModule);
|
||||
|
||||
// FIXME: This is a hack that we shouldn't need, but be sure that we can
|
||||
// see the Swift standard library.
|
||||
|
||||
Reference in New Issue
Block a user