Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Coroutines/CoroInternal.h
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | struct LLVM_LIBRARY_VISIBILITY Shape { | ||||
bool ReuseFrameSlot; | bool ReuseFrameSlot; | ||||
struct SwitchLoweringStorage { | struct SwitchLoweringStorage { | ||||
SwitchInst *ResumeSwitch; | SwitchInst *ResumeSwitch; | ||||
AllocaInst *PromiseAlloca; | AllocaInst *PromiseAlloca; | ||||
BasicBlock *ResumeEntryBlock; | BasicBlock *ResumeEntryBlock; | ||||
unsigned IndexField; | unsigned IndexField; | ||||
unsigned PromiseField; | |||||
rjmccall: Yeah, I think this is never used directly — clients expect to find it by offset, and within the… | |||||
bool HasFinalSuspend; | bool HasFinalSuspend; | ||||
}; | }; | ||||
struct RetconLoweringStorage { | struct RetconLoweringStorage { | ||||
Function *ResumePrototype; | Function *ResumePrototype; | ||||
Function *Alloc; | Function *Alloc; | ||||
Function *Dealloc; | Function *Dealloc; | ||||
BasicBlock *ReturnBlock; | BasicBlock *ReturnBlock; | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | CallingConv::ID getResumeFunctionCC() const { | ||||
llvm_unreachable("Unknown coro::ABI enum"); | llvm_unreachable("Unknown coro::ABI enum"); | ||||
} | } | ||||
AllocaInst *getPromiseAlloca() const { | AllocaInst *getPromiseAlloca() const { | ||||
if (ABI == coro::ABI::Switch) | if (ABI == coro::ABI::Switch) | ||||
return SwitchLowering.PromiseAlloca; | return SwitchLowering.PromiseAlloca; | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
unsigned getPromiseField() const { | |||||
assert(ABI == coro::ABI::Switch); | |||||
assert(FrameTy && "frame type not assigned"); | |||||
assert(SwitchLowering.PromiseAlloca && "no promise alloca"); | |||||
return SwitchLowering.PromiseField; | |||||
} | |||||
/// Allocate memory according to the rules of the active lowering. | /// Allocate memory according to the rules of the active lowering. | ||||
/// | /// | ||||
/// \param CG - if non-null, will be updated for the new call | /// \param CG - if non-null, will be updated for the new call | ||||
Value *emitAlloc(IRBuilder<> &Builder, Value *Size, CallGraph *CG) const; | Value *emitAlloc(IRBuilder<> &Builder, Value *Size, CallGraph *CG) const; | ||||
/// Deallocate memory according to the rules of the active lowering. | /// Deallocate memory according to the rules of the active lowering. | ||||
/// | /// | ||||
Show All 16 Lines |
Yeah, I think this is never used directly — clients expect to find it by offset, and within the function it's of course just referenced as a value.