Skip to content

Commit bceaab3

Browse files
authored
Merge pull request #15829 from eeckstein/fix-pa-forwarder
IRGen: fix a wrong tail-call attribute in a partial apply forwarder
2 parents da6d078 + 3c79bc3 commit bceaab3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ static llvm::Function *emitPartialApplicationForwarder(IRGenModule &IGM,
10631063
if (RetainableValue->getType() != subIGF.IGM.RefCountedPtrTy)
10641064
RetainableValue = subIGF.Builder.CreateBitCast(
10651065
RetainableValue, subIGF.IGM.RefCountedPtrTy);
1066+
needsAllocas = true;
10661067
auto temporary = subIGF.createAlloca(RetainableValue->getType(),
10671068
subIGF.IGM.getPointerAlignment(),
10681069
"partial-apply.context");

test/IRGen/partial_apply.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ sil public_external @indirect_consumed_captured_class_param : $@convention(thin)
131131
// CHECK-NOT: load
132132
// CHECK-NOT: retain
133133
// CHECK-NOT: release
134-
// CHECK: [[RESULT:%.*]] = tail call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, %T13partial_apply10SwiftClassC** noalias nocapture dereferenceable({{.*}}) [[X_CAST]])
134+
// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, %T13partial_apply10SwiftClassC** noalias nocapture dereferenceable({{.*}}) [[X_CAST]])
135135
// CHECK-NOT: retain
136136
// CHECK-NOT: release
137137
// CHECK: ret i64 [[RESULT]]

0 commit comments

Comments
 (0)