Skip to content

Commit 595dfdc

Browse files
authored
Merge pull request #60602 from hborla/print-any-everywhere
[PrintOptions] Print explicit `any` in SIL.
2 parents a851866 + 8713d78 commit 595dfdc

File tree

246 files changed

+3050
-3045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+3050
-3045
lines changed

include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ struct PrintOptions {
679679
static PrintOptions printQualifiedSILType() {
680680
PrintOptions result = PrintOptions::printSIL();
681681
result.FullyQualifiedTypesIfAmbiguous = true;
682+
result.PrintExplicitAny = true;
682683
return result;
683684
}
684685

lib/SIL/IR/SILPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,6 +4067,7 @@ PrintOptions PrintOptions::printSIL(const SILPrintContext *ctx) {
40674067
result.PrintInSILBody = true;
40684068
result.PreferTypeRepr = false;
40694069
result.PrintIfConfig = false;
4070+
result.PrintExplicitAny = true;
40704071
result.OpaqueReturnTypePrinting =
40714072
OpaqueReturnTypePrintingMode::StableReference;
40724073
if (ctx && ctx->printFullConvention())

lib/Sema/TypeCheckType.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,9 @@ TypeResolver::resolveAttributedType(TypeAttributes &attrs, TypeRepr *repr,
25072507
attrs.has(TAK_objc_metatype)) {
25082508
if (auto SF = getDeclContext()->getParentSourceFile()) {
25092509
if (SF->Kind == SourceFileKind::SIL) {
2510+
if (auto existential = dyn_cast<ExistentialTypeRepr>(repr))
2511+
repr = existential->getConstraint();
2512+
25102513
TypeRepr *base;
25112514
if (auto metatypeRepr = dyn_cast<MetatypeTypeRepr>(repr)) {
25122515
base = metatypeRepr->getBase();

test/AutoDiff/SILOptimizer/activity_analysis.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func checked_cast_branch(_ x: Float) -> Float {
141141
// CHECK: [NONE] %2 = metatype $@thin Int.Type
142142
// CHECK: [NONE] %3 = metatype $@thick Int.Type
143143
// CHECK: bb1:
144-
// CHECK: [NONE] %5 = argument of bb1 : $@thick Any.Type
144+
// CHECK: [NONE] %5 = argument of bb1 : $@thick any Any.Type
145145
// CHECK: [NONE] %6 = integer_literal $Builtin.Int1, -1
146146
// CHECK: bb2:
147147
// CHECK: [NONE] %8 = argument of bb2 : $@thick Int.Type
@@ -162,7 +162,7 @@ func checked_cast_branch(_ x: Float) -> Float {
162162
// CHECK: [ACTIVE] %23 = apply %22(%0, %0, %21) : $@convention(method) (Float, Float, @thin Float.Type) -> Float
163163

164164
// CHECK-LABEL: sil hidden [ossa] @${{.*}}checked_cast_branch{{.*}} : $@convention(thin) (Float) -> Float {
165-
// CHECK: checked_cast_br %3 : $@thick Int.Type to Any.Type, bb1, bb2
165+
// CHECK: checked_cast_br %3 : $@thick Int.Type to any Any.Type, bb1, bb2
166166
// CHECK: }
167167

168168
@differentiable(reverse)
@@ -552,12 +552,12 @@ func testTryApply(_ x: Float) -> Float {
552552
// CHECK: bb0:
553553
// CHECK: [ACTIVE] %0 = argument of bb0 : $Float
554554
// CHECK: [NONE] // function_ref closure #1 in testTryApply(_:)
555-
// CHECK: [NONE] %3 = thin_to_thick_function %2 : $@convention(thin) () -> @error Error to $@noescape @callee_guaranteed () -> @error Error
555+
// CHECK: [NONE] %3 = thin_to_thick_function %2 : $@convention(thin) () -> @error any Error to $@noescape @callee_guaranteed () -> @error any Error
556556
// CHECK: [NONE] // function_ref rethrowing(_:)
557557
// CHECK: bb1:
558558
// CHECK: [NONE] %6 = argument of bb1 : $()
559559
// CHECK: bb2:
560-
// CHECK: [NONE] %8 = argument of bb2 : $Error
560+
// CHECK: [NONE] %8 = argument of bb2 : $any Error
561561

562562
//===----------------------------------------------------------------------===//
563563
// Coroutine differentiation (`begin_apply`)

test/ClangImporter/serialization-sil.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@
77
// @_transparent to force serialization.
88
@_transparent
99
public func testPartialApply(_ obj: Test) {
10-
// CHECK-LABEL: @$s4Test16testPartialApplyyySoAA_pF : $@convention(thin) (@guaranteed Test) -> () {
10+
// CHECK-LABEL: @$s4Test16testPartialApplyyySoAA_pF : $@convention(thin) (@guaranteed any Test) -> () {
1111
if let curried1 = obj.normalObject {
12-
// CHECK: dynamic_method_br [[CURRIED1_OBJ:%.+]] : $@opened([[CURRIED1_EXISTENTIAL:.+]], Test) Self, #Test.normalObject!foreign, [[CURRIED1_TRUE:[^,]+]], [[CURRIED1_FALSE:[^,]+]]
12+
// CHECK: dynamic_method_br [[CURRIED1_OBJ:%.+]] : $@opened([[CURRIED1_EXISTENTIAL:.+]], any Test) Self, #Test.normalObject!foreign, [[CURRIED1_TRUE:[^,]+]], [[CURRIED1_FALSE:[^,]+]]
1313
// CHECK: [[CURRIED1_FALSE]]:
14-
// CHECK: [[CURRIED1_TRUE]]([[CURRIED1_METHOD:%.+]] : $@convention(objc_method) (@opened([[CURRIED1_EXISTENTIAL]], Test) Self) -> @autoreleased AnyObject):
14+
// CHECK: [[CURRIED1_TRUE]]([[CURRIED1_METHOD:%.+]] : $@convention(objc_method) (@opened([[CURRIED1_EXISTENTIAL]], any Test) Self) -> @autoreleased AnyObject):
1515
// CHECK: [[CURRIED1_OBJECT_COPY:%.*]] = copy_value [[CURRIED1_OBJ]]
16-
// CHECK: [[CURRIED1_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[CURRIED1_METHOD]]([[CURRIED1_OBJECT_COPY]]) : $@convention(objc_method) (@opened([[CURRIED1_EXISTENTIAL]], Test) Self) -> @autoreleased AnyObject
16+
// CHECK: [[CURRIED1_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[CURRIED1_METHOD]]([[CURRIED1_OBJECT_COPY]]) : $@convention(objc_method) (@opened([[CURRIED1_EXISTENTIAL]], any Test) Self) -> @autoreleased AnyObject
1717
// CHECK: [[CURRIED1_THUNK:%.+]] = function_ref @$syXlIego_ypIegr_TR : $@convention(thin) (@guaranteed @callee_guaranteed () -> @owned AnyObject) -> @out Any
1818
// CHECK: = partial_apply [callee_guaranteed] [[CURRIED1_THUNK]]([[CURRIED1_PARTIAL]])
1919
curried1()
2020
}
2121
if let curried2 = obj.innerPointer {
22-
// CHECK: dynamic_method_br [[CURRIED2_OBJ:%.+]] : $@opened([[CURRIED2_EXISTENTIAL:.+]], Test) Self, #Test.innerPointer!foreign, [[CURRIED2_TRUE:[^,]+]], [[CURRIED2_FALSE:[^,]+]]
22+
// CHECK: dynamic_method_br [[CURRIED2_OBJ:%.+]] : $@opened([[CURRIED2_EXISTENTIAL:.+]], any Test) Self, #Test.innerPointer!foreign, [[CURRIED2_TRUE:[^,]+]], [[CURRIED2_FALSE:[^,]+]]
2323
// CHECK: [[CURRIED2_FALSE]]:
24-
// CHECK: [[CURRIED2_TRUE]]([[CURRIED2_METHOD:%.+]] : $@convention(objc_method) (@opened([[CURRIED2_EXISTENTIAL]], Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer):
24+
// CHECK: [[CURRIED2_TRUE]]([[CURRIED2_METHOD:%.+]] : $@convention(objc_method) (@opened([[CURRIED2_EXISTENTIAL]], any Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer):
2525
// CHECK: [[CURRIED2_OBJ_COPY:%.*]] = copy_value [[CURRIED2_OBJ]]
26-
// CHECK: [[CURRIED2_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[CURRIED2_METHOD]]([[CURRIED2_OBJ_COPY]]) : $@convention(objc_method) (@opened([[CURRIED2_EXISTENTIAL]], Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer
26+
// CHECK: [[CURRIED2_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[CURRIED2_METHOD]]([[CURRIED2_OBJ_COPY]]) : $@convention(objc_method) (@opened([[CURRIED2_EXISTENTIAL]], any Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer
2727
curried2()
2828
}
2929
if let prop1 = obj.normalObjectProp {
30-
// CHECK: dynamic_method_br [[PROP1_OBJ:%.+]] : $@opened([[PROP1_EXISTENTIAL:.+]], Test) Self, #Test.normalObjectProp!getter.foreign, [[PROP1_TRUE:[^,]+]], [[PROP1_FALSE:[^,]+]]
30+
// CHECK: dynamic_method_br [[PROP1_OBJ:%.+]] : $@opened([[PROP1_EXISTENTIAL:.+]], any Test) Self, #Test.normalObjectProp!getter.foreign, [[PROP1_TRUE:[^,]+]], [[PROP1_FALSE:[^,]+]]
3131
// CHECK: [[PROP1_FALSE]]:
32-
// CHECK: [[PROP1_TRUE]]([[PROP1_METHOD:%.+]] : $@convention(objc_method) (@opened([[PROP1_EXISTENTIAL]], Test) Self) -> @autoreleased AnyObject):
32+
// CHECK: [[PROP1_TRUE]]([[PROP1_METHOD:%.+]] : $@convention(objc_method) (@opened([[PROP1_EXISTENTIAL]], any Test) Self) -> @autoreleased AnyObject):
3333
// CHECK: [[PROP1_OBJ_COPY:%.*]] = copy_value [[PROP1_OBJ]]
34-
// CHECK: [[PROP1_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[PROP1_METHOD]]([[PROP1_OBJ_COPY]]) : $@convention(objc_method) (@opened([[PROP1_EXISTENTIAL]], Test) Self) -> @autoreleased AnyObject
34+
// CHECK: [[PROP1_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[PROP1_METHOD]]([[PROP1_OBJ_COPY]]) : $@convention(objc_method) (@opened([[PROP1_EXISTENTIAL]], any Test) Self) -> @autoreleased AnyObject
3535
// CHECK: = apply [[PROP1_PARTIAL]]() : $@callee_guaranteed () -> @owned AnyObject
3636
_ = prop1
3737
}
3838
if let prop2 = obj.innerPointerProp {
39-
// CHECK: dynamic_method_br [[PROP2_OBJ:%.+]] : $@opened([[PROP2_EXISTENTIAL:.+]], Test) Self, #Test.innerPointerProp!getter.foreign, [[PROP2_TRUE:[^,]+]], [[PROP2_FALSE:[^,]+]]
39+
// CHECK: dynamic_method_br [[PROP2_OBJ:%.+]] : $@opened([[PROP2_EXISTENTIAL:.+]], any Test) Self, #Test.innerPointerProp!getter.foreign, [[PROP2_TRUE:[^,]+]], [[PROP2_FALSE:[^,]+]]
4040
// CHECK: [[PROP2_FALSE]]:
41-
// CHECK: [[PROP2_TRUE]]([[PROP2_METHOD:%.+]] : $@convention(objc_method) (@opened([[PROP2_EXISTENTIAL]], Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer):
41+
// CHECK: [[PROP2_TRUE]]([[PROP2_METHOD:%.+]] : $@convention(objc_method) (@opened([[PROP2_EXISTENTIAL]], any Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer):
4242
// CHECK: [[PROP2_OBJ_COPY:%.*]] = copy_value [[PROP2_OBJ]]
43-
// CHECK: [[PROP2_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[PROP2_METHOD]]([[PROP2_OBJ_COPY]]) : $@convention(objc_method) (@opened([[PROP2_EXISTENTIAL]], Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer
43+
// CHECK: [[PROP2_PARTIAL:%.+]] = partial_apply [callee_guaranteed] [[PROP2_METHOD]]([[PROP2_OBJ_COPY]]) : $@convention(objc_method) (@opened([[PROP2_EXISTENTIAL]], any Test) Self) -> @unowned_inner_pointer UnsafeMutableRawPointer
4444
// CHECK: = apply [[PROP2_PARTIAL]]() : $@callee_guaranteed () -> UnsafeMutableRawPointer
4545
_ = prop2
4646
}

test/Concurrency/async_main.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ func asyncFunc() async {
3232
// CHECK-EXEC-NEXT: 43
3333

3434
// static MyProgram.main()
35-
// CHECK-SIL-LABEL: sil hidden @$s10async_main9MyProgramV0B0yyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error Error
35+
// CHECK-SIL-LABEL: sil hidden @$s10async_main9MyProgramV0B0yyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error any Error
3636

3737

3838
// static MyProgram.$main()
39-
// CHECK-SIL-LABEL: sil hidden @$s10async_main9MyProgramV5$mainyyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error Error
39+
// CHECK-SIL-LABEL: sil hidden @$s10async_main9MyProgramV5$mainyyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error any Error
4040

4141

4242
// async_Main
4343
// CHECK-SIL_LABEL: sil hidden @async_Main : $@convention(thin) @async () -> () {
4444
// call main
4545
// CHECK-SIL: %0 = metatype $@thin MyProgram.Type // user: %2
4646
// CHECK-SIL-NEXT: // function_ref static MyProgram.$main()
47-
// CHECK-SIL-NEXT: %1 = function_ref @$s10async_main9MyProgramV5$mainyyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error Error // user: %2
48-
// CHECK-SIL-NEXT: try_apply %1(%0) : $@convention(method) @async (@thin MyProgram.Type) -> @error Error, normal bb1, error bb2 // id: %2
47+
// CHECK-SIL-NEXT: %1 = function_ref @$s10async_main9MyProgramV5$mainyyYaKFZ : $@convention(method) @async (@thin MyProgram.Type) -> @error any Error // user: %2
48+
// CHECK-SIL-NEXT: try_apply %1(%0) : $@convention(method) @async (@thin MyProgram.Type) -> @error any Error, normal bb1, error bb2 // id: %2
4949

5050
// unwrap error and exit or explode
5151
// CHECK-SIL: bb1(%3 : $()):
@@ -56,8 +56,8 @@ func asyncFunc() async {
5656
// CHECK-SIL-NEXT: %7 = apply %6(%5) : $@convention(c) (Int32) -> Never
5757
// CHECK-SIL-NEXT: unreachable
5858

59-
// CHECK-SIL: bb2(%9 : $Error):
60-
// CHECK-SIL-NEXT: %10 = builtin "errorInMain"(%9 : $Error) : $()
59+
// CHECK-SIL: bb2(%9 : $any Error):
60+
// CHECK-SIL-NEXT: %10 = builtin "errorInMain"(%9 : $any Error) : $()
6161
// CHECK-SIL-NEXT: unreachable
6262

6363
// main
@@ -68,12 +68,12 @@ func asyncFunc() async {
6868
// CHECK-SIL-NEXT: %3 = integer_literal $Builtin.Int64, 2048
6969
// CHECK-SIL-NEXT: %4 = struct $Int (%3 : $Builtin.Int64)
7070
// CHECK-SIL-NEXT: %5 = metatype $@thick ().Type
71-
// CHECK-SIL-NEXT: %6 = init_existential_metatype %5 : $@thick ().Type, $@thick Any.Type
71+
// CHECK-SIL-NEXT: %6 = init_existential_metatype %5 : $@thick ().Type, $@thick any Any.Type
7272
// CHECK-SIL-NEXT: // function_ref thunk for @escaping @convention(thin) @async () -> ()
73-
// CHECK-SIL-NEXT: %7 = function_ref @$sIetH_yts5Error_pIegHrzo_TR : $@convention(thin) @async (@convention(thin) @async () -> ()) -> (@out (), @error Error)
74-
// CHECK-SIL-NEXT: %8 = partial_apply [callee_guaranteed] %7(%2) : $@convention(thin) @async (@convention(thin) @async () -> ()) -> (@out (), @error Error)
75-
// CHECK-SIL-NEXT: %9 = convert_function %8 : $@async @callee_guaranteed () -> (@out (), @error Error) to $@async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error Error) for <()>
76-
// CHECK-SIL-NEXT: %10 = builtin "createAsyncTask"<()>(%4 : $Int, %6 : $@thick Any.Type, %9 : $@async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error Error) for <()>) : $(Builtin.NativeObject, Builtin.RawPointer)
73+
// CHECK-SIL-NEXT: %7 = function_ref @$sIetH_yts5Error_pIegHrzo_TR : $@convention(thin) @async (@convention(thin) @async () -> ()) -> (@out (), @error any Error)
74+
// CHECK-SIL-NEXT: %8 = partial_apply [callee_guaranteed] %7(%2) : $@convention(thin) @async (@convention(thin) @async () -> ()) -> (@out (), @error any Error)
75+
// CHECK-SIL-NEXT: %9 = convert_function %8 : $@async @callee_guaranteed () -> (@out (), @error any Error) to $@async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <()>
76+
// CHECK-SIL-NEXT: %10 = builtin "createAsyncTask"<()>(%4 : $Int, %6 : $@thick any Any.Type, %9 : $@async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <()>) : $(Builtin.NativeObject, Builtin.RawPointer)
7777
// CHECK-SIL-NEXT: %11 = tuple_extract %10 : $(Builtin.NativeObject, Builtin.RawPointer), 0
7878
// CHECK-SIL-NEXT: // function_ref swift_job_run
7979
// CHECK-SIL-NEXT: %12 = function_ref @swift_job_run : $@convention(thin) (UnownedJob, UnownedSerialExecutor) -> ()

test/Constraints/ranking.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,43 @@ func genericNoOptional<T>(_: T) {}
3232

3333
// CHECK-LABEL: sil hidden [ossa] @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlF
3434
func propertyVersusFunction<T : P>(_ p: P, _ t: T) {
35-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
35+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
3636
let _ = p.p
37-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
37+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
3838
let _: P = p.p
39-
// CHECK: function_ref @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlFyAaC_pcAaC_pcfu_ : $@convention(thin) (@in_guaranteed P) -> @owned @callee_guaranteed (@in_guaranteed P) -> ()
39+
// CHECK: function_ref @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlFyAaC_pcAaC_pcfu_ : $@convention(thin) (@in_guaranteed any P) -> @owned @callee_guaranteed (@in_guaranteed any P) -> ()
4040
let _: (P) -> () = p.p
41-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
41+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
4242
let _: P? = p.p
43-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
43+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
4444
let _: Any = p.p
45-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
45+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
4646
let _: Any? = p.p
4747

48-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
48+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
4949
// CHECK: function_ref @$s7ranking15genericOverloadyyxlF
5050
genericOverload(p.p)
51-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.q!getter
51+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.q!getter
5252
// CHECK: function_ref @$s7ranking15genericOverloadyyxSglF
5353
genericOverload(p.q)
54-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
54+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
5555
// CHECK: function_ref @$s7ranking15genericOptionalyyxSglF
5656
genericOptional(p.p)
57-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.q!getter
57+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.q!getter
5858
// CHECK: function_ref @$s7ranking15genericOptionalyyxSglF
5959
genericOptional(p.q)
60-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.p!getter
60+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.p!getter
6161
// CHECK: function_ref @$s7ranking17genericNoOptionalyyxlF
6262
genericNoOptional(p.p)
63-
// CHECK: witness_method $@opened("{{.*}}", P) Self, #P.q!getter
63+
// CHECK: witness_method $@opened("{{.*}}", any P) Self, #P.q!getter
6464
// CHECK: function_ref @$s7ranking17genericNoOptionalyyxlF
6565
genericNoOptional(p.q)
6666

6767
// CHECK: witness_method $T, #P.p!getter
6868
let _ = t.p
6969
// CHECK: witness_method $T, #P.p!getter
7070
let _: P = t.p
71-
// CHECK: function_ref @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlFyAaC_pcxcfu1_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @owned @callee_guaranteed (@in_guaranteed P) -> ()
71+
// CHECK: function_ref @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlFyAaC_pcxcfu1_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @owned @callee_guaranteed (@in_guaranteed any P) -> ()
7272
let _: (P) -> () = t.p
7373
// CHECK: witness_method $T, #P.p!getter
7474
let _: P? = t.p
@@ -103,7 +103,7 @@ extension P {
103103
let _ = self.p
104104
// CHECK: witness_method $Self, #P.p!getter
105105
let _: P = self.p
106-
// CHECK: function_ref @$s7ranking1PPAAE22propertyVersusFunctionyyFyAaB_pcxcfu_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @owned @callee_guaranteed (@in_guaranteed P) -> ()
106+
// CHECK: function_ref @$s7ranking1PPAAE22propertyVersusFunctionyyFyAaB_pcxcfu_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @owned @callee_guaranteed (@in_guaranteed any P) -> ()
107107
let _: (P) -> () = self.p
108108
// CHECK: witness_method $Self, #P.p!getter
109109
let _: P? = self.p
@@ -311,7 +311,7 @@ struct S2 {
311311
// We currently prefer the non-variadic init due to having
312312
// "less effective parameters", and we don't compare the types for ranking due
313313
// to the difference in variadic-ness.
314-
// CHECK: function_ref @$s7ranking2S2VyAcA1R_pcfC : $@convention(method) (@in R, @thin S2.Type) -> S2
314+
// CHECK: function_ref @$s7ranking2S2VyAcA1R_pcfC : $@convention(method) (@in any R, @thin S2.Type) -> S2
315315
_ = S2(0)
316316
}
317317
}

test/Distributed/SIL/distributed_actor_default_init_sil_4.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ distributed actor MyDistActor {
2929
}
3030

3131
// CHECK-LABEL: // MyDistActor.init(system_async_fail_throws:cond:)
32-
// CHECK: sil hidden @$s14default_deinit11MyDistActorC24system_async_fail_throws4condACSg015FakeDistributedE7Systems0kE6SystemV_SbtYaKcfc : $@convention(method) @async (@owned FakeActorSystem, Bool, @owned MyDistActor) -> (@owned Optional<MyDistActor>, @error Error) {
32+
// CHECK: sil hidden @$s14default_deinit11MyDistActorC24system_async_fail_throws4condACSg015FakeDistributedE7Systems0kE6SystemV_SbtYaKcfc : $@convention(method) @async (@owned FakeActorSystem, Bool, @owned MyDistActor) -> (@owned Optional<MyDistActor>, @error any Error) {
3333
// CHECK: bb0([[SYSTEM:%[0-9]+]] : $FakeActorSystem, [[COND:%[0-9]+]] : $Bool, [[SELF:%[0-9]+]] : $MyDistActor):
3434
// CHECK: cond_br {{%[0-9]+}}, [[SUCCESS_BB:bb[0-9]+]], [[FAIL_BB:bb[0-9]+]]
3535

@@ -43,7 +43,7 @@ distributed actor MyDistActor {
4343
// CHECK: [[RESIGN_FN:%[0-9]+]] = function_ref @$s27FakeDistributedActorSystems0aC6SystemV8resignIDyyAA0C7AddressVF : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
4444
// CHECK: = apply [[RESIGN_FN]]
4545
// CHECK: builtin "destroyDefaultActor"
46-
// CHECK: throw {{%[0-9]+}} : $Error
46+
// CHECK: throw {{%[0-9]+}} : $any Error
4747

4848
// CHECK: [[RET_BB]]:
4949
// CHECK: return

0 commit comments

Comments
 (0)