Skip to content

Commit e59dcd1

Browse files
committed
[NFC] IRGen: Vend a FunctionPointer of this helper
1 parent 05f259f commit e59dcd1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,13 @@ llvm::Constant *irgen::getCoroFrameAllocStubFn(IRGenModule &IGM) {
904904
/*optionalLinkageOverride=*/nullptr, llvm::CallingConv::C);
905905
}
906906

907+
FunctionPointer irgen::getCoroFrameAllocStubFunctionPointer(IRGenModule &IGM) {
908+
auto *fn = cast<llvm::Function>(getCoroFrameAllocStubFn(IGM));
909+
auto sig = Signature::forFunction(fn);
910+
return FunctionPointer::forDirect(FunctionPointerKind::Function, fn, nullptr,
911+
sig);
912+
}
913+
907914
static Size getOffsetOfOpaqueIsolationField(IRGenModule &IGM,
908915
const LoadableTypeInfo &isolationTI) {
909916
auto offset = IGM.RefCountedStructSize;

lib/IRGen/GenFunc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ namespace irgen {
6565
/// Stub function that weakly links againt the swift_coroFrameAlloc
6666
/// function. This is required for back-deployment.
6767
llvm::Constant *getCoroFrameAllocStubFn(IRGenModule &IGM);
68+
FunctionPointer getCoroFrameAllocStubFunctionPointer(IRGenModule &IGM);
6869
} // end namespace irgen
6970
} // end namespace swift
7071

0 commit comments

Comments
 (0)