From: Josh Bleecher Snyder Date: Fri, 21 Apr 2017 21:06:42 +0000 (-0700) Subject: cmd/compile: remove most uses of duintxx X-Git-Tag: go1.9beta1~547 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bea8ffdbb1ea4147c3f815243554afac90b6bb52;p=gostls13.git cmd/compile: remove most uses of duintxx The only remaining uses of duintxx are in the implementation of duintNN. I hope to inline those once I figure out why CL 40864 is broken. Note that some uses of duintxx with width Widthint were converted into duintptr. I did that, since #19954 is officially going to move forward. Passes toolstash-check. Change-Id: Id25253b711ea589d0199b51be9a3c18ca1af59ce Reviewed-on: https://go-review.googlesource.com/41398 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 85d2f5c62b..034661d075 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -332,8 +332,8 @@ func slicebytes(nam *Node, s string, len int) { } off = int(nam.Xoffset) off = dsymptr(nam.Sym.Linksym(), off, sym.Linksym(), 0) - off = duintxx(nam.Sym.Linksym(), off, uint64(len), Widthint) - duintxx(nam.Sym.Linksym(), off, uint64(len), Widthint) + off = duintptr(nam.Sym.Linksym(), off, uint64(len)) + duintptr(nam.Sym.Linksym(), off, uint64(len)) } func dsname(s *obj.LSym, off int, t string) int { diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index d954a899a9..b25eabf2c7 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -459,7 +459,7 @@ func dgopkgpath(s *types.Sym, ot int, pkg *types.Pkg) int { func dgopkgpathLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { if pkg == nil { - return duintxx(s, ot, 0, Widthptr) + return duintptr(s, ot, 0) } if pkg == localpkg && myimportpath == "" { @@ -479,7 +479,7 @@ func dgopkgpathLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { // dgopkgpathOffLSym writes an offset relocation in s at offset ot to the pkg path symbol. func dgopkgpathOffLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { if pkg == nil { - return duintxx(s, ot, 0, 4) + return duint32(s, ot, 0) } if pkg == localpkg && myimportpath == "" { // If we don't know the full import path of the package being compiled @@ -673,7 +673,7 @@ func dextratypeData(s *types.Sym, ot int, t *types.Type) int { } func dmethodptrOffLSym(s *obj.LSym, ot int, x *obj.LSym) int { - duintxx(s, ot, 0, 4) + duint32(s, ot, 0) r := obj.Addrel(s) r.Off = int32(ot) r.Siz = 4 @@ -1204,8 +1204,8 @@ ok: ot = dgopkgpath(s, ot, tpkg) ot = dsymptr(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) - ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) - ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) + ot = duintptr(s.Linksym(), ot, uint64(n)) + ot = duintptr(s.Linksym(), ot, uint64(n)) dataAdd := imethodSize() * n ot = dextratype(s, ot, t, dataAdd) @@ -1297,8 +1297,8 @@ ok: } ot = dgopkgpath(s, ot, pkg) ot = dsymptr(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) - ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) - ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) + ot = duintptr(s.Linksym(), ot, uint64(n)) + ot = duintptr(s.Linksym(), ot, uint64(n)) dataAdd := n * structfieldSize() ot = dextratype(s, ot, t, dataAdd) @@ -1575,7 +1575,7 @@ func dalgsym(t *types.Type) *types.Sym { ot := 0 ot = dsymptr(hashfunc.Linksym(), ot, Runtimepkg.Lookup("memhash_varlen").Linksym(), 0) - ot = duintxx(hashfunc.Linksym(), ot, uint64(t.Width), Widthptr) // size encoded in closure + ot = duintptr(hashfunc.Linksym(), ot, uint64(t.Width)) // size encoded in closure ggloblsym(hashfunc, int32(ot), obj.DUPOK|obj.RODATA) // make equality closure @@ -1585,7 +1585,7 @@ func dalgsym(t *types.Type) *types.Sym { ot = 0 ot = dsymptr(eqfunc.Linksym(), ot, Runtimepkg.Lookup("memequal_varlen").Linksym(), 0) - ot = duintxx(eqfunc.Linksym(), ot, uint64(t.Width), Widthptr) + ot = duintptr(eqfunc.Linksym(), ot, uint64(t.Width)) ggloblsym(eqfunc, int32(ot), obj.DUPOK|obj.RODATA) } else { // generate an alg table specific to this type