]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ssa: replace uses of interface{} with Sym/Aux
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Sat, 29 Mar 2025 18:49:25 +0000 (19:49 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 31 Mar 2025 15:20:16 +0000 (08:20 -0700)
Change-Id: I0a3ce2e823697eee5bb5e7d5ea0ef025132c0689
Reviewed-on: https://go-review.googlesource.com/c/go/+/661655
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/ssa/rewrite.go

index b441d68536deec1311afe283d78ee899ad483fff..dd09330717c67791fd5c40826279841fa9e7456e 100644 (file)
@@ -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)) {