@@ -1083,6 +1083,13 @@ static llvm::Constant *getAddrOfGlobalCoroAllocator(
10831083 return taskAllocator;
10841084}
10851085
1086+ static llvm::Constant *getAddrOfGlobalCoroAllocator (
1087+ IRGenModule &IGM, CoroAllocatorKind kind, bool shouldDeallocateImmediately,
1088+ llvm::Constant *allocFn, llvm::Constant *deallocFn) {
1089+ return getAddrOfGlobalCoroAllocator (IGM, kind, shouldDeallocateImmediately,
1090+ allocFn, deallocFn, allocFn, deallocFn);
1091+ }
1092+
10861093static llvm::Constant *getAddrOfSwiftCoroMalloc (
10871094 IRGenModule &IGM) {
10881095 return getAddrOfSwiftCoroAllocThunk (" _swift_coro_malloc" ,
@@ -1098,13 +1105,10 @@ static llvm::Constant *getAddrOfSwiftCoroFree(
10981105}
10991106
11001107llvm::Constant *IRGenModule::getAddrOfGlobalCoroMallocAllocator () {
1101- return getAddrOfGlobalCoroAllocator (
1102- *this , CoroAllocatorKind::Malloc,
1103- /* shouldDeallocateImmediately=*/ true ,
1104- getAddrOfSwiftCoroMalloc (*this ),
1105- getAddrOfSwiftCoroFree (*this ),
1106- getAddrOfSwiftCoroMalloc (*this ),
1107- getAddrOfSwiftCoroFree (*this ));
1108+ return getAddrOfGlobalCoroAllocator (*this , CoroAllocatorKind::Malloc,
1109+ /* shouldDeallocateImmediately=*/ true ,
1110+ getAddrOfSwiftCoroMalloc (*this ),
1111+ getAddrOfSwiftCoroFree (*this ));
11081112}
11091113
11101114static llvm::Constant *
@@ -1122,13 +1126,10 @@ getAddrOfSwiftCoroTaskDealloc(IRGenModule &IGM) {
11221126}
11231127
11241128llvm::Constant *IRGenModule::getAddrOfGlobalCoroAsyncTaskAllocator () {
1125- return getAddrOfGlobalCoroAllocator (
1126- *this , CoroAllocatorKind::Async,
1127- /* shouldDeallocateImmediately=*/ false ,
1128- getAddrOfSwiftCoroTaskAlloc (*this ),
1129- getAddrOfSwiftCoroTaskDealloc (*this ),
1130- getAddrOfSwiftCoroTaskAlloc (*this ),
1131- getAddrOfSwiftCoroTaskDealloc (*this ));
1129+ return getAddrOfGlobalCoroAllocator (*this , CoroAllocatorKind::Async,
1130+ /* shouldDeallocateImmediately=*/ false ,
1131+ getAddrOfSwiftCoroTaskAlloc (*this ),
1132+ getAddrOfSwiftCoroTaskDealloc (*this ));
11321133}
11331134
11341135llvm::Value *
0 commit comments