File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 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) {
14371437void SILGenModule::emitFunction (FuncDecl *fd) {
14381438 assert (!shouldSkipDecl (fd));
14391439
1440- Types.setCaptureTypeExpansionContext (SILDeclRef (fd), M);
1441-
14421440 SILDeclRef::Loc decl = fd;
14431441
14441442 emitAbstractFuncDecl (fd);
14451443
1446- if (shouldEmitFunctionBody (fd))
1444+ if (shouldEmitFunctionBody (fd)) {
1445+ Types.setCaptureTypeExpansionContext (SILDeclRef (fd), M);
14471446 emitOrDelayFunction (SILDeclRef (decl));
1447+ }
14481448}
14491449
14501450void SILGenModule::addGlobalVariable (VarDecl *global) {
Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
22// 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
34
45guard let x: Int = nil else { while true { } }
56
67// 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) -> () {
79func capturesX( ) {
810 _ = x
911}
1012
1113// CHECK-LABEL: sil hidden [ossa] @$s18top_level_captures17transitiveCaptureyyF : $@convention(thin) (Int) -> () {
1214// 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) -> ()
1317func transitiveCapture( ) {
1418 capturesX ( )
1519}
You can’t perform that action at this time.
0 commit comments