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

@@ -579,7 +579,7 @@ void ObjectOutliner::replaceFindStringCall(ApplyInst *FindStringCall) {
{ FindStringCall->getArgument(0),
FindStringCall->getArgument(1),
CacheAddr },
FindStringCall->isNonThrowing());
FindStringCall->getApplyOptions());
FindStringCall->replaceAllUsesWith(NewCall);
FindStringCall->eraseFromParent();