From eec3745bd7861f447bfe5fe5a27314079d46acec Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Sat, 29 Mar 2025 19:49:25 +0100 Subject: [PATCH] cmd/compile/internal/ssa: replace uses of interface{} with Sym/Aux Change-Id: I0a3ce2e823697eee5bb5e7d5ea0ef025132c0689 Reviewed-on: https://go-review.googlesource.com/c/go/+/661655 Reviewed-by: Dmitri Shuralyov Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/rewrite.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index b441d68536..dd09330717 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -419,9 +419,9 @@ func canMergeLoad(target, load *Value) bool { return true } -// isSameCall reports whether sym is the same as the given named symbol. -func isSameCall(sym interface{}, name string) bool { - fn := sym.(*AuxCall).Fn +// isSameCall reports whether aux is the same as the given named symbol. +func isSameCall(aux Aux, name string) bool { + fn := aux.(*AuxCall).Fn return fn != nil && fn.String() == name } @@ -1960,7 +1960,7 @@ func needRaceCleanup(sym *AuxCall, v *Value) bool { } // symIsRO reports whether sym is a read-only global. -func symIsRO(sym interface{}) bool { +func symIsRO(sym Sym) bool { lsym := sym.(*obj.LSym) return lsym.Type == objabi.SRODATA && len(lsym.R) == 0 } @@ -2051,7 +2051,7 @@ func fixedSym(f *Func, sym Sym, off int64) Sym { } // read8 reads one byte from the read-only global sym at offset off. -func read8(sym interface{}, off int64) uint8 { +func read8(sym Sym, off int64) uint8 { lsym := sym.(*obj.LSym) if off >= int64(len(lsym.P)) || off < 0 { // Invalid index into the global sym. @@ -2064,7 +2064,7 @@ func read8(sym interface{}, off int64) uint8 { } // read16 reads two bytes from the read-only global sym at offset off. -func read16(sym interface{}, off int64, byteorder binary.ByteOrder) uint16 { +func read16(sym Sym, off int64, byteorder binary.ByteOrder) uint16 { lsym := sym.(*obj.LSym) // lsym.P is written lazily. // Bytes requested after the end of lsym.P are 0. @@ -2078,7 +2078,7 @@ func read16(sym interface{}, off int64, byteorder binary.ByteOrder) uint16 { } // read32 reads four bytes from the read-only global sym at offset off. -func read32(sym interface{}, off int64, byteorder binary.ByteOrder) uint32 { +func read32(sym Sym, off int64, byteorder binary.ByteOrder) uint32 { lsym := sym.(*obj.LSym) var src []byte if 0 <= off && off < int64(len(lsym.P)) { @@ -2090,7 +2090,7 @@ func read32(sym interface{}, off int64, byteorder binary.ByteOrder) uint32 { } // read64 reads eight bytes from the read-only global sym at offset off. -func read64(sym interface{}, off int64, byteorder binary.ByteOrder) uint64 { +func read64(sym Sym, off int64, byteorder binary.ByteOrder) uint64 { lsym := sym.(*obj.LSym) var src []byte if 0 <= off && off < int64(len(lsym.P)) { -- 2.51.0