Skip to content

Commit 0c2d874

Browse files
authored
Merge pull request #18920 from mikeash/willthrow-error-register
[Runtime][ABI] Have swift_willThrow take the error value in the return register.
2 parents 7687063 + 6b4aaf3 commit 0c2d874

15 files changed

+86
-33
lines changed

include/swift/AST/Builtins.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ BUILTIN_SIL_OPERATION(IdentityKeyPath, "identityKeyPath", Special)
387387
BUILTIN(Id, Name, Attrs)
388388
#endif
389389

390-
/// willThrow: Error -> ()
391-
BUILTIN_RUNTIME_CALL(WillThrow, "willThrow", "n")
392-
393390
/// unexpectedError: Error -> ()
394391
BUILTIN_RUNTIME_CALL(UnexpectedError, "unexpectedError", "")
395392

@@ -539,6 +536,9 @@ BUILTIN_MISC_OPERATION(GetObjCTypeEncoding, "getObjCTypeEncoding", "n", Special)
539536
// Swift3ImplicitObjCEntrypoint has type () -> ()
540537
BUILTIN_MISC_OPERATION(Swift3ImplicitObjCEntrypoint, "swift3ImplicitObjCEntrypoint", "", Special)
541538

539+
/// willThrow: Error -> ()
540+
BUILTIN_MISC_OPERATION(WillThrow, "willThrow", "", Special)
541+
542542
#undef BUILTIN_MISC_OPERATION
543543

544544
/// Builtins for instrumentation added by sanitizers during SILGen.

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ FUNCTION(SlowDealloc, swift_slowDealloc, C_CC,
130130
ATTRS(NoUnwind))
131131

132132
// void swift_willThrow(error *ptr);
133-
FUNCTION(WillThrow, swift_willThrow, C_CC,
133+
FUNCTION(WillThrow, swift_willThrow, SwiftCC,
134134
RETURNS(VoidTy),
135-
ARGS(ErrorPtrTy),
135+
ARGS(Int8PtrTy, ErrorPtrTy->getPointerTo()),
136136
ATTRS(NoUnwind))
137137

138138
// void swift_errorInMain(error *ptr);

lib/IRGen/GenBuiltin.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,40 @@ if (Builtin.ID == BuiltinValueKind::id) { \
353353
#define BUILTIN(ID, Name, Attrs) // Ignore the rest.
354354
#include "swift/AST/Builtins.def"
355355

356+
if (Builtin.ID == BuiltinValueKind::WillThrow) {
357+
// willThrow is emitted like a Swift function call with the error in
358+
// the error return register. We also have to pass a fake context
359+
// argument due to how swiftcc works in clang.
360+
361+
auto *fn = cast<llvm::Function>(IGF.IGM.getWillThrowFn());
362+
auto error = args.claimNext();
363+
auto errorBuffer = IGF.getErrorResultSlot(
364+
SILType::getPrimitiveObjectType(IGF.IGM.Context.getErrorDecl()
365+
->getDeclaredType()
366+
->getCanonicalType()));
367+
IGF.Builder.CreateStore(error, errorBuffer);
368+
369+
auto context = llvm::UndefValue::get(IGF.IGM.Int8PtrTy);
370+
371+
llvm::CallInst *call = IGF.Builder.CreateCall(fn,
372+
{context, errorBuffer.getAddress()});
373+
call->setCallingConv(IGF.IGM.SwiftCC);
374+
call->addAttribute(llvm::AttributeList::FunctionIndex,
375+
llvm::Attribute::NoUnwind);
376+
call->addAttribute(llvm::AttributeList::FirstArgIndex + 1,
377+
llvm::Attribute::ReadOnly);
378+
379+
auto attrs = call->getAttributes();
380+
IGF.IGM.addSwiftSelfAttributes(attrs, 0);
381+
IGF.IGM.addSwiftErrorAttributes(attrs, 1);
382+
call->setAttributes(attrs);
383+
384+
IGF.Builder.CreateStore(llvm::ConstantPointerNull::get(IGF.IGM.ErrorPtrTy),
385+
errorBuffer);
386+
387+
return out.add(call);
388+
}
389+
356390
if (Builtin.ID == BuiltinValueKind::FNeg) {
357391
llvm::Value *rhs = args.claimNext();
358392
llvm::Value *lhs = llvm::ConstantFP::get(rhs->getType(), "-0.0");

lib/IRGen/GenCall.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,22 @@ void IRGenModule::addSwiftSelfAttributes(llvm::AttributeList &attrs,
182182

183183
void IRGenModule::addSwiftErrorAttributes(llvm::AttributeList &attrs,
184184
unsigned argIndex) {
185-
// Don't add the swifterror attribute on ABI that don't pass it in a register.
185+
llvm::AttrBuilder b;
186+
// Don't add the swifterror attribute on ABIs that don't pass it in a register.
186187
// We create a shadow stack location of the swifterror parameter for the
187188
// debugger on such platforms and so we can't mark the parameter with a
188189
// swifterror attribute.
189-
if (!this->IsSwiftErrorInRegister)
190-
return;
191-
192-
llvm::AttrBuilder b;
193-
b.addAttribute(llvm::Attribute::SwiftError);
194-
attrs = attrs.addAttributes(this->LLVMContext,
195-
argIndex + llvm::AttributeList::FirstArgIndex, b);
190+
if (IsSwiftErrorInRegister)
191+
b.addAttribute(llvm::Attribute::SwiftError);
192+
193+
// The error result should not be aliased, captured, or pointed at invalid
194+
// addresses regardless.
195+
b.addAttribute(llvm::Attribute::NoAlias);
196+
b.addAttribute(llvm::Attribute::NoCapture);
197+
b.addDereferenceableAttr(getPointerSize().getValue());
198+
199+
auto attrIndex = argIndex + llvm::AttributeList::FirstArgIndex;
200+
attrs = attrs.addAttributes(this->LLVMContext, attrIndex, b);
196201
}
197202

198203
void irgen::addByvalArgumentAttributes(IRGenModule &IGM,

lib/SIL/MemAccessUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
527527
builtin->dump();
528528
llvm_unreachable("unexpected bulitin memory access.");
529529

530+
// WillThrow exists for the debugger, does nothing.
531+
case BuiltinValueKind::WillThrow:
532+
return;
533+
530534
// Buitins that affect memory but can't be formal accesses.
531535
case BuiltinValueKind::UnexpectedError:
532536
case BuiltinValueKind::ErrorInMain:

stdlib/public/runtime/ErrorObject.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ SWIFT_RUNTIME_STDLIB_API
206206
void swift_errorRelease(SwiftError *object);
207207

208208
/// Breakpoint hook for debuggers.
209-
SWIFT_RUNTIME_STDLIB_API
210-
void swift_willThrow(SwiftError *object);
209+
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
210+
void swift_willThrow(SWIFT_CONTEXT void *unused,
211+
SWIFT_ERROR_RESULT SwiftError **object);
211212

212213
/// Halt in response to an error.
213214
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API LLVM_ATTRIBUTE_NORETURN

stdlib/public/runtime/ErrorObject.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,9 @@ ProtocolDescriptorRef theErrorProtocol(&PROTOCOL_DESCR_SYM(s5Error),
555555
}
556556

557557
/// Breakpoint hook for debuggers.
558-
void
559-
swift::swift_willThrow(SwiftError *error) {
558+
SWIFT_CC(swift) void
559+
swift::swift_willThrow(SWIFT_CONTEXT void *unused,
560+
SWIFT_ERROR_RESULT SwiftError **error) {
560561
// empty
561562
}
562563

stdlib/public/runtime/ErrorObjectNative.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ swift::swift_getErrorValue(const SwiftError *errorObject,
106106
out->errorConformance = errorObject->errorConformance;
107107
}
108108

109-
void swift::swift_willThrow(SwiftError *object) { }
109+
/// Breakpoint hook for debuggers.
110+
SWIFT_CC(swift) void
111+
swift::swift_willThrow(SWIFT_CONTEXT void *unused,
112+
SWIFT_ERROR_RESULT SwiftError **error) {
113+
// do nothing
114+
}
110115

111116
#endif

test/DebugInfo/ErrorVar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum MyError : Error {
1111
// thrown error we create a shadow stack location holding the address of the
1212
// location that holds the pointer to the error instead.
1313
func simple(_ placeholder: Int64) throws -> () {
14-
// CHECK: define {{.*}}void @"$S8ErrorVar6simpleyys5Int64VKF"(i64, %swift.refcounted* swiftself, %swift.error**)
14+
// CHECK: define {{.*}}void @"$S8ErrorVar6simpleyys5Int64VKF"(i64, %swift.refcounted* swiftself, %swift.error** noalias nocapture dereferenceable(4))
1515
// CHECK: call void @llvm.dbg.declare
1616
// CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[ERROR:[0-9]+]], metadata !DIExpression(DW_OP_deref))
1717
// CHECK: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$Ss5Error_pD"

test/IRGen/abitypes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,17 +446,17 @@ class Foo {
446446
return g.invert(b)
447447
}
448448

449-
// x86_64-macosx: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** swifterror) {{.*}} {
449+
// x86_64-macosx: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** noalias nocapture swifterror dereferenceable(8)) {{.*}} {
450450
// x86_64-macosx: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 8
451451
// x86_64-macosx: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
452452
// x86_64-macosx: }
453453

454-
// x86_64-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** swifterror) {{.*}} {
454+
// x86_64-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** noalias nocapture swifterror dereferenceable(8)) {{.*}} {
455455
// x86_64-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 8
456456
// x86_64-ios: call zeroext i1 bitcast (void ()* @objc_msgSend to i1 (%1*, i8*, i1, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext {{%[0-9]+}}, %2** {{%[0-9]+}})
457457
// x86_64-ios: }
458458

459-
// i386-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error**) {{.*}} {
459+
// i386-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** noalias nocapture dereferenceable(4)) {{.*}} {
460460
// i386-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 4
461461
// i386-ios: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
462462
// i386-ios: }

test/IRGen/big_types_corner_cases.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bb0(%0 : $_ArrayBuffer<Element>):
6565
return %9 : $BigTempStruct<Element>
6666
}
6767

68-
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(%T22big_types_corner_cases9BigStructV* noalias nocapture sret, i8*, %swift.refcounted*, %swift.refcounted* swiftself, %swift.error** swifterror)
68+
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(%T22big_types_corner_cases9BigStructV* noalias nocapture sret, i8*, %swift.refcounted*, %swift.refcounted* swiftself, %swift.error** noalias nocapture swifterror dereferenceable(8))
6969
// CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV
7070
// CHECK: call swiftcc void {{.*}}(%T22big_types_corner_cases9BigStructV* noalias nocapture sret [[ALLOC]]
7171
// CHECK: ret void

test/IRGen/big_types_corner_cases.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,11 @@ public extension sr8076_QueryHandler {
335335
}
336336

337337
// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$S22big_types_corner_cases19sr8076_QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0e1_F0Rd__lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type*{{.*}}, %swift.type*{{.*}}, i8** {{.*}}.sr8076_QueryHandler, i8** {{.*}}.sr8076_Query, %swift.opaque* noalias nocapture swiftself, %swift.error** swifterror)
338-
// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** nocapture swifterror {{.*}})
338+
// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** noalias nocapture swifterror {{.*}})
339339
// CHECK-64: ret { i64, i64 }
340340

341341
// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$S22big_types_corner_cases19sr8076_QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0e1_F0Rd__lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type*{{.*}}, %swift.type*{{.*}}, i8** {{.*}}.sr8076_QueryHandler, i8** {{.*}}.sr8076_Query, %swift.opaque* noalias nocapture swiftself, %swift.error** swifterror)
342-
// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** nocapture {{.*}})
342+
// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** noalias nocapture {{.*}})
343343
// CHECK-32: ret { i32, i32 }
344344
func forceHandle_4<Q: sr8076_Query>(query: Q) throws -> (Q.Returned, sr8076_Filter?) {
345345
guard let body = handle_4 as? (Q) throws -> (Q.Returned, sr8076_Filter?) else {

test/IRGen/errors.sil

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ sil @does_throw : $@convention(thin) () -> @error Error {
2626
%0 = function_ref @create_error : $@convention(thin) () -> @owned Error
2727
%1 = apply %0() : $@convention(thin) () -> @owned Error
2828

29-
// CHECK-NEXT: call void @swift_willThrow
29+
// CHECK-NEXT: store %swift.error* [[T0]], %swift.error** %1,
30+
// CHECK-NEXT: call swiftcc void @swift_willThrow
31+
// CHECK-NEXT: store %swift.error* null, %swift.error** %1,
3032
// CHECK-NEXT: store %swift.error* [[T0]], %swift.error** %1,
3133
// CHECK-NEXT: ret void
3234
builtin "willThrow"(%1 : $Error) : $()
@@ -64,8 +66,8 @@ entry(%0 : $AnyObject):
6466
// CHECK-aarch64: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] %swift.error*, align
6567
// CHECK-NEXT: store %swift.error* null, %swift.error** [[ERRORSLOT]], align
6668

67-
// CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc %objc_object* @try_apply_helper(%objc_object* %0, %swift.refcounted* swiftself undef, %swift.error** nocapture [[SWIFTERROR]]{{( )?}}[[ERRORSLOT]])
68-
// CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc %swift.refcounted* @try_apply_helper(%swift.refcounted* %0, %swift.refcounted* swiftself undef, %swift.error** nocapture [[SWIFTERROR]]{{( )?}}[[ERRORSLOT]])
69+
// CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc %objc_object* @try_apply_helper(%objc_object* %0, %swift.refcounted* swiftself undef, %swift.error** noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]])
70+
// CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc %swift.refcounted* @try_apply_helper(%swift.refcounted* %0, %swift.refcounted* swiftself undef, %swift.error** noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]])
6971
// CHECK-NEXT: [[ERR:%.*]] = load %swift.error*, %swift.error** [[ERRORSLOT]], align
7072
// CHECK-NEXT: [[T0:%.*]] = icmp ne %swift.error* [[ERR]], null
7173
// CHECK-NEXT: br i1 [[T0]],
@@ -100,7 +102,7 @@ enum ColorError : Error {
100102
}
101103

102104
// CHECK-LABEL: TestCallToWillThrowCallBack
103-
// CHECK: call void @swift_willThrow(%swift.error* %0)
105+
// CHECK: call swiftcc void @swift_willThrow(i8* swiftself undef, %swift.error** noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2)
104106
// CHECK: store %swift.error* %0
105107
// CHECK: ret i64 undef
106108
sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) {
@@ -113,9 +115,9 @@ bb0(%0 : $Error):
113115

114116
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { i8*, %swift.refcounted* } @partial_apply_single(%T6errors1AC*)
115117
// CHECK: insertvalue { i8*, %swift.refcounted* } { i8* bitcast (void (%swift.refcounted*, %swift.error**)* @"$S27partial_apply_single_helperTA" to i8*), %swift.refcounted* undef },
116-
// CHECK: define internal swiftcc void @"$S27partial_apply_single_helperTA"(%swift.refcounted* swiftself, %swift.error**{{( )?}}[[SWIFTERROR]])
118+
// CHECK: define internal swiftcc void @"$S27partial_apply_single_helperTA"(%swift.refcounted* swiftself, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable({{.}}))
117119
// CHECK: [[T0:%.*]] = bitcast %swift.refcounted* {{%.*}} to %T6errors1AC*
118-
// CHECK-NEXT: tail call swiftcc void @partial_apply_single_helper(%T6errors1AC* [[T0]], %swift.refcounted* swiftself undef, %swift.error**{{( )?}}[[SWIFTERROR]]{{( )?}}{{%.*}})
120+
// CHECK-NEXT: tail call swiftcc void @partial_apply_single_helper(%T6errors1AC* [[T0]], %swift.refcounted* swiftself undef, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable({{.}}){{( )?}}{{%.*}})
119121
// CHECK-NEXT: ret void
120122
sil @partial_apply_single : $@convention(thin) (@owned A) -> @callee_owned () -> @error Error {
121123
entry(%0 : $A):

test/IRGen/protocol_resilience_thunks.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public protocol MyResilientProtocol {
5959
// CHECK-NEXT: call swiftcc void [[FN]](%Any* noalias nocapture sret %0, %swift.opaque* noalias nocapture swiftself %1, %swift.type* %2, i8** %3)
6060
// CHECK-NEXT: ret void
6161

62-
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(%swift.opaque* noalias nocapture swiftself, %swift.error**{{( swifterror)?}}, %swift.type*, i8**)
62+
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(%swift.opaque* noalias nocapture swiftself, %swift.error**{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}}, %swift.type*, i8**)
6363
// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds i8*, i8** %3, i32 4
6464
// CHECK-NEXT: [[WITNESS:%.*]] = load i8*, i8** [[WITNESS_ADDR]]
6565
// CHECK-NEXT: [[FN:%.*]] = bitcast i8* [[WITNESS]] to void (%swift.opaque*, %swift.error**, %swift.type*, i8**)*
66-
// CHECK-NEXT: call swiftcc void [[FN]](%swift.opaque* noalias nocapture swiftself %0, %swift.error**{{( swifterror)?}} %1, %swift.type* %2, i8** %3)
66+
// CHECK-NEXT: call swiftcc void [[FN]](%swift.opaque* noalias nocapture swiftself %0, %swift.error**{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, %swift.type* %2, i8** %3)
6767
// CHECK-NEXT: ret void
6868

6969
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP11genericFuncyqd__qd__lFTj"(%swift.opaque* noalias nocapture sret, %swift.opaque* noalias nocapture, %swift.type*, %swift.opaque* noalias nocapture swiftself, %swift.type*, i8**)

test/SILOptimizer/sil_combine_apply.sil

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ sil @try_apply_func : $@convention(thin) () -> (Builtin.Int32, @error Error)
202202
// CHECK-NEXT: dealloc_stack [[NEW_ALLOC_STACK]]
203203
// CHECK-NEXT: return
204204
// CHECK: bb6(
205+
// CHECK-NEXT: builtin "willThrow"
205206
// CHECK-NEXT: dealloc_stack [[NEW_ALLOC_STACK]]
206207
// CHECK-NEXT: throw
207208
// CHECK: } // end sil function 'sil_combine_dead_partial_apply_try_apply'

0 commit comments

Comments
 (0)