mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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 <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>
This commit is contained in:
parent
bfc209518e
commit
eec3745bd7
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user