]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/asm: refine some APIs related to Prog.RestArgs[]
authorruinan <ruinan.sun@arm.com>
Wed, 12 Apr 2023 03:23:13 +0000 (11:23 +0800)
committerEric Fang <eric.fang@arm.com>
Wed, 24 May 2023 01:26:58 +0000 (01:26 +0000)
commitcf624a612743d1ff9d010072f978bd4417c0522d
tree93ac337603416d023a893b765c3c0eee8c0ed956
parentbdc5533f391ad60303b16a906668f5112ea0a2a2
cmd/asm: refine some APIs related to Prog.RestArgs[]

Before this CL, we use GetFrom3&SetFrom3 to get or set a source operand
which not fit into Prog.Reg. Those APIs operate the first element in
Prog.RestArgs without checking the type so they're fragile to break if
we have more than one different type of operands in the slice, which
will be a common case in Arm64.

This CL deprecates & renames some APIs related to Prog.RestArgs to make
those APIs more reasonable and robust than before.

Change-Id: I70d56edc1f23ccfffbcd6df34844e2cef2288432
Reviewed-on: https://go-review.googlesource.com/c/go/+/493355
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Eric Fang <eric.fang@arm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
12 files changed:
src/cmd/asm/internal/asm/asm.go
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/arm/ssa.go
src/cmd/compile/internal/arm64/ssa.go
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/riscv64/ssa.go
src/cmd/compile/internal/s390x/ssa.go
src/cmd/compile/internal/x86/ssa.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/pass.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/x86/obj6.go