File tree 2 files changed +7
-3
lines changed 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1437,14 +1437,14 @@ void SILGenModule::emitAbstractFuncDecl(AbstractFunctionDecl *AFD) {
1437
1437
void SILGenModule::emitFunction (FuncDecl *fd) {
1438
1438
assert (!shouldSkipDecl (fd));
1439
1439
1440
- Types.setCaptureTypeExpansionContext (SILDeclRef (fd), M);
1441
-
1442
1440
SILDeclRef::Loc decl = fd;
1443
1441
1444
1442
emitAbstractFuncDecl (fd);
1445
1443
1446
- if (shouldEmitFunctionBody (fd))
1444
+ if (shouldEmitFunctionBody (fd)) {
1445
+ Types.setCaptureTypeExpansionContext (SILDeclRef (fd), M);
1447
1446
emitOrDelayFunction (SILDeclRef (decl));
1447
+ }
1448
1448
}
1449
1449
1450
1450
void SILGenModule::addGlobalVariable (VarDecl *global) {
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
2
2
// RUN: %target-swift-frontend -enable-experimental-async-top-level -emit-silgen %s | %FileCheck %s
3
+ // RUN: %target-swift-frontend -experimental-skip-non-inlinable-function-bodies -experimental-skip-non-inlinable-function-bodies-without-types -emit-silgen %s | %FileCheck -check-prefix=SKIPPED-FUNC-EMITTED %s
3
4
4
5
guard let x: Int = nil else { while true { } }
5
6
6
7
// CHECK-LABEL: sil hidden [ossa] @$s18top_level_captures0C1XyyF : $@convention(thin) (Int) -> () {
8
+ // SKIPPED-FUNC-EMITTED-LABEL-NOT: sil hidden [ossa] @$s18top_level_captures0C1XyyF : $@convention(thin) (Int) -> () {
7
9
func capturesX( ) {
8
10
_ = x
9
11
}
10
12
11
13
// CHECK-LABEL: sil hidden [ossa] @$s18top_level_captures17transitiveCaptureyyF : $@convention(thin) (Int) -> () {
12
14
// CHECK: [[FUNC:%.*]] = function_ref @$s18top_level_captures0C1XyyF : $@convention(thin) (Int) -> ()
15
+ // SKIPPED-FUNC-EMITTED-LABEL-NOT: sil hidden [ossa] @$s18top_level_captures17transitiveCaptureyyF : $@convention(thin) (Int) -> () {
16
+ // SKIPPED-FUNC-EMITTED-NOT: [[FUNC:%.*]] = function_ref @$s18top_level_captures0C1XyyF : $@convention(thin) (Int) -> ()
13
17
func transitiveCapture( ) {
14
18
capturesX ( )
15
19
}
You can’t perform that action at this time.
0 commit comments