File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -548,17 +548,6 @@ bool SILFunction::isNoReturnFunction(TypeExpansionContext context) const {
548
548
}
549
549
550
550
ResilienceExpansion SILFunction::getResilienceExpansion () const {
551
- // If package serialization is enabled, we can safely
552
- // assume that the defining .swiftmodule is built from
553
- // source and is never used outside of its package;
554
- // Even if the module is built resiliently, return
555
- // maximal expansion here so aggregate types can be
556
- // treated as loadable in the same resilient domain
557
- // (across modules in the same package).
558
- if (getModule ().getSwiftModule ()->serializePackageEnabled () &&
559
- getModule ().getSwiftModule ()->isResilient ())
560
- return ResilienceExpansion::Maximal;
561
-
562
551
// If a function definition is in another module, and
563
552
// it was serialized due to package serialization opt,
564
553
// a new attribute [serialized_for_package] is added
Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ public func runPub(_ arg: PubStruct) -> Int {
239
239
public func runPubInlinable( _ arg: Int ) -> PubStruct {
240
240
// CHECK-RES-DAG: sil [serialized] [serialized_for_package] [canonical] @$s3Lib15runPubInlinableyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PubStruct {
241
241
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib15runPubInlinableyAA0C6StructVSiF : $@convention(thin) (Int) -> PubStruct {
242
- // CHECK-RES-DAG: alloc_stack [var_decl] $PubStruct
242
+ // CHECK-RES-DAG: alloc_stack {{.*}} [var_decl] $PubStruct
243
243
// CHECK-RES-DAG: function_ref @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> @out PubStruct
244
244
// CHECK-NONRES-DAG: function_ref @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> PubStruct
245
245
var x = PubStruct ( 1 )
@@ -485,3 +485,22 @@ final package class FinalPkgKlass {
485
485
// CHECK-COMMON-NEXT: method #PkgProto.data!setter: <Self where Self : PkgProto> (inout Self) -> (Int) -> () : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivsTW
486
486
// CHECK-COMMON-NEXT: method #PkgProto.data!modify: <Self where Self : PkgProto> (inout Self) -> () -> () : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivMTW
487
487
// CHECK-COMMON-NEXT: method #PkgProto.pkgfunc: <Self where Self : PkgProto> (Self) -> (Int) -> Int : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP7pkgfuncyS2iFTW
488
+
489
+ public struct Something {
490
+ public init ( ) { }
491
+
492
+ public func f( ) -> Int {
493
+ return 7
494
+ }
495
+ }
496
+
497
+ @usableFromInline
498
+ func use( _ c: ( ) -> Int ) { }
499
+
500
+ // Don't crash on this example
501
+ @inlinable
502
+ public func reproduce( _ e: Something ) {
503
+ use {
504
+ return e. f ( )
505
+ }
506
+ }
You can’t perform that action at this time.
0 commit comments