Skip to content

Commit 67cbe90

Browse files
authored
Merge pull request #62427 from tshortli/back-deployed-attr-skip-noninlinable-function-bodies
Serialization: Update `-experimental-skip-non-inlinable-function-bodies` SIL verification for `@_backDeploy`
2 parents 0eeadff + e0cce4a commit 67cbe90

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/SILOptimizer/UtilityPasses/SILSkippingChecker.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ static bool shouldHaveSkippedFunction(const SILFunction &F) {
7272
return false;
7373
}
7474

75+
// Functions with @_backDeploy may be copied into the client, so they
76+
// shouldn't be skipped. The SILFunction that may be copied into the client
77+
// should be serialized and therefore is already handled above. However, a
78+
// second resilient SILFunction is also emitted for back deployed functions.
79+
// Since the body of the function as written was not skipped, it's expected
80+
// that we see the SILFunction for the resilient copy here.
81+
if (func->isBackDeployed())
82+
return false;
83+
7584
// If none of those conditions trip, then this is something that _should_
7685
// be serialized in the module even when we're skipping non-inlinable
7786
// function bodies.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %target-swift-frontend -parse-as-library -enable-library-evolution -emit-module -module-name Test -experimental-skip-non-inlinable-function-bodies %s
2+
3+
@available(SwiftStdlib 5.6, *)
4+
@_backDeploy(before: SwiftStdlib 5.7)
5+
public func foo() {}

0 commit comments

Comments
 (0)