mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
To enable ABIs which store extra info in the frame, add two new slots to the coroutine allocator function table. For example, a frame could have a header containing a context pointer at a negative offset from the address returned from `swift_coro_alloc_frame`. The frame deallocation function would then know to deallocate more space correspondingly.
29 lines
983 B
C++
29 lines
983 B
C++
//===----- GenCoro.h - Code generation related to coroutines --------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
namespace swift {
|
|
namespace irgen {
|
|
|
|
class IRGenModule;
|
|
|
|
llvm::Constant *getCoroAllocFn(IRGenModule &IGM);
|
|
llvm::Constant *getCoroAllocFrameFn(IRGenModule &IGM);
|
|
llvm::Constant *getCoroDeallocFn(IRGenModule &IGM);
|
|
llvm::Constant *getCoroDeallocFrameFn(IRGenModule &IGM);
|
|
|
|
llvm::Value *
|
|
emitYieldOnce2CoroutineAllocator(IRGenFunction &IGF,
|
|
std::optional<CoroAllocatorKind> kind);
|
|
|
|
} // end namespace irgen
|
|
} // end namespace swift
|