Skip to content

Commit eec3745

Browse files
mateusz834gopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent bfc2095 commit eec3745

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/cmd/compile/internal/ssa/rewrite.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ func canMergeLoad(target, load *Value) bool {
419419
return true
420420
}
421421

422-
// isSameCall reports whether sym is the same as the given named symbol.
423-
func isSameCall(sym interface{}, name string) bool {
424-
fn := sym.(*AuxCall).Fn
422+
// isSameCall reports whether aux is the same as the given named symbol.
423+
func isSameCall(aux Aux, name string) bool {
424+
fn := aux.(*AuxCall).Fn
425425
return fn != nil && fn.String() == name
426426
}
427427

@@ -1960,7 +1960,7 @@ func needRaceCleanup(sym *AuxCall, v *Value) bool {
19601960
}
19611961

19621962
// symIsRO reports whether sym is a read-only global.
1963-
func symIsRO(sym interface{}) bool {
1963+
func symIsRO(sym Sym) bool {
19641964
lsym := sym.(*obj.LSym)
19651965
return lsym.Type == objabi.SRODATA && len(lsym.R) == 0
19661966
}
@@ -2051,7 +2051,7 @@ func fixedSym(f *Func, sym Sym, off int64) Sym {
20512051
}
20522052

20532053
// read8 reads one byte from the read-only global sym at offset off.
2054-
func read8(sym interface{}, off int64) uint8 {
2054+
func read8(sym Sym, off int64) uint8 {
20552055
lsym := sym.(*obj.LSym)
20562056
if off >= int64(len(lsym.P)) || off < 0 {
20572057
// Invalid index into the global sym.
@@ -2064,7 +2064,7 @@ func read8(sym interface{}, off int64) uint8 {
20642064
}
20652065

20662066
// read16 reads two bytes from the read-only global sym at offset off.
2067-
func read16(sym interface{}, off int64, byteorder binary.ByteOrder) uint16 {
2067+
func read16(sym Sym, off int64, byteorder binary.ByteOrder) uint16 {
20682068
lsym := sym.(*obj.LSym)
20692069
// lsym.P is written lazily.
20702070
// Bytes requested after the end of lsym.P are 0.
@@ -2078,7 +2078,7 @@ func read16(sym interface{}, off int64, byteorder binary.ByteOrder) uint16 {
20782078
}
20792079

20802080
// read32 reads four bytes from the read-only global sym at offset off.
2081-
func read32(sym interface{}, off int64, byteorder binary.ByteOrder) uint32 {
2081+
func read32(sym Sym, off int64, byteorder binary.ByteOrder) uint32 {
20822082
lsym := sym.(*obj.LSym)
20832083
var src []byte
20842084
if 0 <= off && off < int64(len(lsym.P)) {
@@ -2090,7 +2090,7 @@ func read32(sym interface{}, off int64, byteorder binary.ByteOrder) uint32 {
20902090
}
20912091

20922092
// read64 reads eight bytes from the read-only global sym at offset off.
2093-
func read64(sym interface{}, off int64, byteorder binary.ByteOrder) uint64 {
2093+
func read64(sym Sym, off int64, byteorder binary.ByteOrder) uint64 {
20942094
lsym := sym.(*obj.LSym)
20952095
var src []byte
20962096
if 0 <= off && off < int64(len(lsym.P)) {

0 commit comments

Comments
 (0)