[NFC] IRGen: Vend a FunctionPointer of this helper

This commit is contained in:
Nate Chandler
2025-10-29 15:36:35 -07:00
parent 05f259f6f6
commit e59dcd1725
2 changed files with 8 additions and 0 deletions

View File

@@ -904,6 +904,13 @@ llvm::Constant *irgen::getCoroFrameAllocStubFn(IRGenModule &IGM) {
/*optionalLinkageOverride=*/nullptr, llvm::CallingConv::C);
}
FunctionPointer irgen::getCoroFrameAllocStubFunctionPointer(IRGenModule &IGM) {
auto *fn = cast<llvm::Function>(getCoroFrameAllocStubFn(IGM));
auto sig = Signature::forFunction(fn);
return FunctionPointer::forDirect(FunctionPointerKind::Function, fn, nullptr,
sig);
}
static Size getOffsetOfOpaqueIsolationField(IRGenModule &IGM,
const LoadableTypeInfo &isolationTI) {
auto offset = IGM.RefCountedStructSize;

View File

@@ -65,6 +65,7 @@ namespace irgen {
/// Stub function that weakly links againt the swift_coroFrameAlloc
/// function. This is required for back-deployment.
llvm::Constant *getCoroFrameAllocStubFn(IRGenModule &IGM);
FunctionPointer getCoroFrameAllocStubFunctionPointer(IRGenModule &IGM);
} // end namespace irgen
} // end namespace swift