Skip to content

Commit 6a19cae

Browse files
authored
Merge pull request #39235 from nkcsgexi/82822440-2
ClangImporter: import SPIs from underlying clang modules by default
2 parents 7cab446 + f2c868d commit 6a19cae

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Sema/ImportResolution.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ ModuleImplicitImportsRequest::evaluate(Evaluator &evaluator,
513513
unloadedImports.emplace_back(UnloadedImportedModule(importPath.copyTo(ctx),
514514
/*isScoped=*/false),
515515
ImportFlags::Exported);
516-
imports.back().options |= ImportFlags::SPIAccessControl;
517-
imports.back().spiGroups = ctx.AllocateCopy(clangSpiGroups);
516+
unloadedImports.back().options |= ImportFlags::SPIAccessControl;
517+
unloadedImports.back().spiGroups = ctx.AllocateCopy(clangSpiGroups);
518518
}
519519

520520
return { ctx.AllocateCopy(imports), ctx.AllocateCopy(unloadedImports) };

test/ClangImporter/availability_spi_as_unavailable.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// REQUIRES: OS=macosx
2-
// RUN: %target-swift-frontend -typecheck %s -F %S/Inputs/frameworks -verify
2+
// RUN: %target-swift-frontend -typecheck %s -F %S/Inputs/frameworks -verify -DNOT_UNDERLYING
3+
// RUN: %target-swift-frontend -typecheck %s -F %S/Inputs/frameworks -module-name SPIContainer -import-underlying-module -verify
34

5+
#if NOT_UNDERLYING
46
import SPIContainer
7+
#endif
58

69
@_spi(a) public let a: SPIInterface1
710
@_spi(a) public let b: SPIInterface2

0 commit comments

Comments
 (0)