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:
Slava Pestov
2021-03-02 02:26:07 -05:00
parent 9216af8b04
commit 7ccc41a7b7
48 changed files with 413 additions and 200 deletions

View File

@@ -56,7 +56,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 601; // diagnose invalid AST
const uint16_t SWIFTMODULE_VERSION_MINOR = 602; // noasync apply
/// A standard hash seed used for all string hashes in a serialized module.
///