Skip to content

Commit 41bb2e0

Browse files
committed
[Package CMO] Remove workaround for skipped types in serializability pass
This PR removes the workaround previously added to handle types that were overlooked during the initial serializability pass. With `InstructionVisitor` now ensuring comprehensive serializability checks in that pass, the workaround is no longer needed. Resolves rdar://137711038
1 parent 6fc80d6 commit 41bb2e0

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

lib/SILOptimizer/IPO/CrossModuleOptimization.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -927,21 +927,6 @@ void CrossModuleOptimization::makeDeclUsableFromInline(ValueDecl *decl) {
927927
if (decl->getEffectiveAccess() >= AccessLevel::Package)
928928
return;
929929

930-
// FIXME: rdar://130456707
931-
// Currently not all types are visited in canSerialize* calls, sometimes
932-
// resulting in an internal type getting @usableFromInline, which is
933-
// incorrect.
934-
// For example, for `let q = P() as? Q`, where Q is an internal class
935-
// inherting a public class P, Q is not visited in the canSerialize*
936-
// checks, thus resulting in `@usableFromInline class Q`; this is not
937-
// the intended behavior in the conservative mode as it modifies AST.
938-
//
939-
// To properly fix, instruction visitor needs to be refactored to do
940-
// both the "canSerialize" check (that visits all types) and serialize
941-
// or update visibility (modify AST in non-conservative modes).
942-
if (isPackageCMOEnabled(M.getSwiftModule()))
943-
return;
944-
945930
// We must not modify decls which are defined in other modules.
946931
if (M.getSwiftModule() != decl->getDeclContext()->getParentModule())
947932
return;

0 commit comments

Comments
 (0)