]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove most uses of duintxx
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 21 Apr 2017 21:06:42 +0000 (14:06 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 21 Apr 2017 23:15:00 +0000 (23:15 +0000)
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 <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/reflect.go

index 85d2f5c62b9c3dc6861944f63fd1c42dbb61979c..034661d075136e9ac4e0f934b5709882af143d60 100644 (file)
@@ -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 {
index d954a899a95f03b173aa40a8de89597312b5fbfd..b25eabf2c73769aac3afce7f8e690ac0e2258b21 100644 (file)
@@ -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