示例#1
0
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)
			}
		}
	}
}
示例#2
0
文件: call.go 项目: MovingtoMars/nnvm
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")
	}
}