File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -689,11 +689,6 @@ func (c *coroutineLoweringPass) lowerFuncCoro(fn *asyncFunc) {
689689 // Lower return value of call.
690690 c .lowerCallReturn (fn , call )
691691
692- // Save coroutine state before calling the function.
693- // %coro.save = call token @llvm.coro.save(i8* %coro.state)
694- c .builder .SetInsertPointBefore (call )
695- save := c .builder .CreateCall (c .coroSave , []llvm.Value {coroState }, "coro.save" )
696-
697692 // Get originating basic block.
698693 bb := call .InstructionParent ()
699694
@@ -702,6 +697,8 @@ func (c *coroutineLoweringPass) lowerFuncCoro(fn *asyncFunc) {
702697
703698 // Insert suspension and switch.
704699 c .builder .SetInsertPointAtEnd (bb )
700+ // %coro.save = call token @llvm.coro.save(i8* %coro.state)
701+ save := c .builder .CreateCall (c .coroSave , []llvm.Value {coroState }, "coro.save" )
705702 // %call.suspend = llvm.coro.suspend(token %coro.save, i1 false)
706703 // switch i8 %call.suspend, label %suspend [i8 0, label %wakeup
707704 // i8 1, label %cleanup]
You can’t perform that action at this time.
0 commit comments