1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:14:49 -07:00

cmd/asm: use opd.String() instead of fmt.Sprintf

Change-Id: Idbade74025bddb26ec3c10527de5af5dc2b8c1cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/435940
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
This commit is contained in:
cuiweixie 2022-09-28 21:23:06 +08:00 committed by Gopher Robot
parent 223a563f58
commit c4a3fae27e

View File

@ -12,7 +12,6 @@ import (
"cmd/internal/obj"
"cmd/internal/obj/arm64"
"errors"
"fmt"
)
var arm64LS = map[string]uint8{
@ -66,8 +65,7 @@ func GetARM64SpecialOperand(name string) arm64.SpecialOperand {
// Generate the mapping automatically when the first time the function is called.
arm64SpecialOperand = map[string]arm64.SpecialOperand{}
for opd := arm64.SPOP_BEGIN; opd < arm64.SPOP_END; opd++ {
s := fmt.Sprintf("%s", opd)
arm64SpecialOperand[s] = opd
arm64SpecialOperand[opd.String()] = opd
}
// Handle some special cases.