@@ -1292,10 +1292,7 @@ static StructType *buildFrameType(Function &F, coro::Shape &Shape,
12921292 std::optional<FieldIDType> SwitchIndexFieldId;
12931293
12941294 if (Shape.ABI == coro::ABI::Switch) {
1295- auto *FramePtrTy = FrameTy->getPointerTo ();
1296- auto *FnTy = FunctionType::get (Type::getVoidTy (C), FramePtrTy,
1297- /* IsVarArg=*/ false );
1298- auto *FnPtrTy = FnTy->getPointerTo ();
1295+ auto *FnPtrTy = PointerType::getUnqual (C);
12991296
13001297 // Add header fields for the resume and destroy functions.
13011298 // We can rely on these being perfectly packed.
@@ -2487,7 +2484,7 @@ static Value *emitGetSwiftErrorValue(IRBuilder<> &Builder, Type *ValueTy,
24872484 coro::Shape &Shape) {
24882485 // Make a fake function pointer as a sort of intrinsic.
24892486 auto FnTy = FunctionType::get (ValueTy, {}, false );
2490- auto Fn = ConstantPointerNull::get (FnTy-> getPointerTo ());
2487+ auto Fn = ConstantPointerNull::get (Builder. getPtrTy ());
24912488
24922489 auto Call = Builder.CreateCall (FnTy, Fn, {});
24932490 Shape.SwiftErrorOps .push_back (Call);
@@ -2501,9 +2498,9 @@ static Value *emitGetSwiftErrorValue(IRBuilder<> &Builder, Type *ValueTy,
25012498static Value *emitSetSwiftErrorValue (IRBuilder<> &Builder, Value *V,
25022499 coro::Shape &Shape) {
25032500 // Make a fake function pointer as a sort of intrinsic.
2504- auto FnTy = FunctionType::get (V-> getType ()-> getPointerTo (),
2501+ auto FnTy = FunctionType::get (Builder. getPtrTy (),
25052502 {V->getType ()}, false );
2506- auto Fn = ConstantPointerNull::get (FnTy-> getPointerTo ());
2503+ auto Fn = ConstantPointerNull::get (Builder. getPtrTy ());
25072504
25082505 auto Call = Builder.CreateCall (FnTy, Fn, { V });
25092506 Shape.SwiftErrorOps .push_back (Call);
0 commit comments