mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Preliminary support for 'apply [noasync]' calls
Refactor SILGen's ApplyOptions into an OptionSet, add a DoesNotAwait flag to go with DoesNotThrow, and sink it all down into SILInstruction.h. Then, replace the isNonThrowing() flag in ApplyInst and BeginApplyInst with getApplyOptions(), and plumb it through to TryApplyInst as well. Set the flag when SILGen emits a sync call to a reasync function. When set, this disables the SIL verifier check against calling async functions from sync functions. Finally, this allows us to add end-to-end tests for rdar://problem/71098795.
This commit is contained in:
@@ -562,7 +562,7 @@ static SILValue emitCodeForConstantArray(ArrayRef<SILValue> elements,
|
||||
FunctionRefInst *arrayAllocateRef =
|
||||
builder.createFunctionRef(loc, arrayAllocateFun);
|
||||
ApplyInst *applyInst = builder.createApply(
|
||||
loc, arrayAllocateRef, subMap, ArrayRef<SILValue>(numElementsSIL), false);
|
||||
loc, arrayAllocateRef, subMap, ArrayRef<SILValue>(numElementsSIL));
|
||||
|
||||
// Extract the elements of the tuple returned by the call to the allocator.
|
||||
DestructureTupleInst *destructureInst =
|
||||
@@ -698,7 +698,7 @@ static SILValue emitCodeForSymbolicValue(SymbolicValue symVal,
|
||||
FunctionRefInst *stringInitRef =
|
||||
builder.createFunctionRef(loc, stringInfo.getStringInitIntrinsic());
|
||||
ApplyInst *applyInst = builder.createApply(
|
||||
loc, stringInitRef, SubstitutionMap(), ArrayRef<SILValue>(args), false);
|
||||
loc, stringInitRef, SubstitutionMap(), ArrayRef<SILValue>(args));
|
||||
return applyInst;
|
||||
}
|
||||
case SymbolicValue::Integer: { // Builtin integer types.
|
||||
|
||||
Reference in New Issue
Block a user