func (v *allocator) allocate(fn *ssa.Function) { for _, par := range fn.Parameters() { v.allocateValue(par) } for _, block := range fn.Blocks() { for _, instr := range block.Instrs() { if val, ok := instr.(ssa.Value); ok { v.allocateValue(val) } } } }
func (v Target) genSaveFunctionParameters(a *allocator, fn *ssa.Function) { var vals []ssa.Value for _, par := range fn.Parameters() { vals = append(vals, par) } if v.Platform.IsUnixLike() { v.sysVCopyFunctionVals(a, vals, fn.Type().(*types.Signature), false) } else if v.Platform == platform.Windows { v.winSaveFunctionParameters(a, vals, fn.Type().(*types.Signature)) } else { panic("unim") } }