Skip to content

Commit 5bc1633

Browse files
committed
cross-module-optimization: don't make imported type declarations usable-from-inline.
Fixes unresolved-symbol linker errors. rdar://87930768
1 parent 2443063 commit 5bc1633

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/IPO/CrossModuleOptimization.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ void CrossModuleOptimization::makeDeclUsableFromInline(ValueDecl *decl) {
511511
if (decl->getEffectiveAccess() >= AccessLevel::Public)
512512
return;
513513

514+
// We must not modify decls which are defined in other modules.
515+
if (M.getSwiftModule() != decl->getDeclContext()->getParentModule())
516+
return;
517+
514518
if (decl->getFormalAccess() < AccessLevel::Public &&
515519
!decl->isUsableFromInline()) {
516520
// Mark the nominal type as "usableFromInline".

0 commit comments

Comments
 (0)