mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 14:33:41 +00:00
compiler: refactor defer operations
This commit is contained in:
committed by
Ron Evans
parent
19bf8acde0
commit
405ec2a563
@@ -958,7 +958,7 @@ func (c *Compiler) parseFunc(frame *Frame) {
|
||||
if frame.fn.Recover != nil {
|
||||
// This function has deferred function calls. Set some things up for
|
||||
// them.
|
||||
c.deferInitFunc(frame)
|
||||
frame.deferInitFunc()
|
||||
}
|
||||
|
||||
// Fill blocks with instructions.
|
||||
@@ -1044,7 +1044,7 @@ func (c *Compiler) parseInstr(frame *Frame, instr ssa.Instruction) {
|
||||
case *ssa.DebugRef:
|
||||
// ignore
|
||||
case *ssa.Defer:
|
||||
c.emitDefer(frame, instr)
|
||||
frame.createDefer(instr)
|
||||
case *ssa.Go:
|
||||
// Get all function parameters to pass to the goroutine.
|
||||
var params []llvm.Value
|
||||
@@ -1127,7 +1127,7 @@ func (c *Compiler) parseInstr(frame *Frame, instr ssa.Instruction) {
|
||||
c.builder.CreateRet(retVal)
|
||||
}
|
||||
case *ssa.RunDefers:
|
||||
c.emitRunDefers(frame)
|
||||
frame.createRunDefers()
|
||||
case *ssa.Send:
|
||||
frame.createChanSend(instr)
|
||||
case *ssa.Store:
|
||||
|
||||
Reference in New Issue
Block a user