Add Builtin.hopToActor

SILGen this builtin to a mandatory hop_to_executor with an actor type
operand.

e.g.

    Task.detached {
      Builtin.hopToActor(MainActor.shared)
      await suspend()
    }

Required to fix a bug in _runAsyncMain.
This commit is contained in:
Andrew Trick
2021-06-13 21:31:36 -07:00
parent 7d11dc5004
commit c4f1f56ea7
20 changed files with 174 additions and 21 deletions

View File

@@ -2154,6 +2154,8 @@ public:
}
void visitHopToExecutorInst(HopToExecutorInst *HTEI) {
if (HTEI->isMandatory())
*this << "[mandatory] ";
*this << getIDAndType(HTEI->getTargetExecutor());
}