func (l LoadConst) ProcessInstr(p InstrProcessor) {
	p.ProcessLoadConstInstr(l)
}
ProcessInstr makes the InstrProcessor process this instruction.
package ir
import (
	"fmt"
	"strings"
	"github.com/arnodel/golua/ops"
)
type Instruction interface {
	fmt.Stringer
	ProcessInstr(InstrProcessor)
}
type SetRegInstruction interface {
	DestReg() Register
	WithDestReg(Register) Instruction
}
type InstrProcessor interface {
	ProcessCombineInstr(Combine)
	ProcessTransformInstr(Transform)
	ProcessLoadConstInstr(LoadConst)
	ProcessPushInstr(Push)
	ProcessJumpInstr(Jump)
	ProcessJumpIfInstr(JumpIf)
	ProcessCallInstr(Call)
	ProcessMkClosureInstr(MkClosure)
	ProcessMkContInstr(MkCont)
	ProcessClearRegInstr(ClearReg)
	ProcessMkTableInstr(MkTable)
	ProcessLookupInstr(Lookup)
	ProcessSetIndexInstr(SetIndex)
	ProcessReceiveInstr(Receive)
	ProcessReceiveEtcInstr(ReceiveEtc)
	ProcessEtcLookupInstr(EtcLookup)
	ProcessFillTableInstr(FillTable)
	ProcessTakeRegisterInstr(TakeRegister)
	ProcessReleaseRegisterInstr(ReleaseRegister)
	ProcessDeclareLabelInstr(DeclareLabel)
}
type Register uint
func (r Register) String() string {
	return fmt.Sprintf("r%d", r)
}
type Label uint
func (l Label) String() string {
	return fmt.Sprintf("L%d", l)
}
type Combine struct {
	Op   ops.Op    
	Dst  Register  
	Lsrc Register  
	Rsrc Register  
}
func (c Combine) DestReg() Register {
	return c.Dst
}
func (c Combine) WithDestReg(r Register) Instruction {
	c.Dst = r
	return c
}
func (c Combine) ProcessInstr(p InstrProcessor) {
	p.ProcessCombineInstr(c)
}
func (c Combine) String() string {
	return fmt.Sprintf("%s := %s(%s, %s)", c.Dst, c.Op, c.Lsrc, c.Rsrc)
}
type Transform struct {
	Op  ops.Op    
	Dst Register  
	Src Register  
}
func (t Transform) DestReg() Register {
	return t.Dst
}
func (t Transform) WithDestReg(r Register) Instruction {
	t.Dst = r
	return t
}
func (t Transform) ProcessInstr(p InstrProcessor) {
	p.ProcessTransformInstr(t)
}
func (t Transform) String() string {
	return fmt.Sprintf("%s := %s(%s)", t.Dst, t.Op, t.Src)
}
type LoadConst struct {
	Dst  Register  
	Kidx uint      
}
func (l LoadConst) DestReg() Register {
	return l.Dst
}
func (l LoadConst) WithDestReg(r Register) Instruction {
	l.Dst = r
	return l
}