@@ -995,25 +995,13 @@ void CrossModuleOptimization::makeFunctionUsableFromInline(SILFunction *function
995
995
}
996
996
}
997
997
998
- // / Make a nominal type, including it's context, usable from inline.
998
+ // / Make a nominal type, including its context, usable from inline.
999
999
void CrossModuleOptimization::makeDeclUsableFromInline (ValueDecl *decl) {
1000
1000
if (decl->getEffectiveAccess () >= AccessLevel::Package)
1001
- return ;
1001
+ return ;
1002
1002
1003
- // FIXME: rdar://130456707
1004
- // Currently not all types are visited in canSerialize* calls, sometimes
1005
- // resulting in an internal type getting @usableFromInline, which is
1006
- // incorrect.
1007
- // For example, for `let q = P() as? Q`, where Q is an internal class
1008
- // inherting a public class P, Q is not visited in the canSerialize*
1009
- // checks, thus resulting in `@usableFromInline class Q`; this is not
1010
- // the intended behavior in the conservative mode as it modifies AST.
1011
- //
1012
- // To properly fix, instruction visitor needs to be refactored to do
1013
- // both the "canSerialize" check (that visits all types) and serialize
1014
- // or update visibility (modify AST in non-conservative modes).
1015
- if (isPackageCMOEnabled (M.getSwiftModule ()))
1016
- return ;
1003
+ // This function should not be called in Package CMO mode.
1004
+ assert (!isPackageCMOEnabled (M.getSwiftModule ()));
1017
1005
1018
1006
// We must not modify decls which are defined in other modules.
1019
1007
if (M.getSwiftModule () != decl->getDeclContext ()->getParentModule ())
0 commit comments