]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: rename mapbucket to bmap
authorMartin Möhrmann <moehrmann@google.com>
Tue, 29 Aug 2017 19:10:17 +0000 (21:10 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Wed, 30 Aug 2017 09:44:34 +0000 (09:44 +0000)
This makes the name of the function to construct the map bucket type
consistent with runtimes naming and the existing hmap function.

Change-Id: If4d8b4a54c92ab914d4adcb96022b48d8b5db631
Reviewed-on: https://go-review.googlesource.com/59915
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/walk.go

index 3e1f26b866d22583b146f4faf3bb2f0392c6e8d9..c436c55c6ae41e92da2b8ca817e62893d8ca8fe9 100644 (file)
@@ -96,7 +96,8 @@ func makefield(name string, t *types.Type) *types.Field {
        return f
 }
 
-func mapbucket(t *types.Type) *types.Type {
+// bmap makes the map bucket type given the type of the map.
+func bmap(t *types.Type) *types.Type {
        if t.MapType().Bucket != nil {
                return t.MapType().Bucket
        }
@@ -204,16 +205,16 @@ func mapbucket(t *types.Type) *types.Type {
                Fatalf("bucket align not multiple of value align %v", t)
        }
        if keys.Offset%int64(keytype.Align) != 0 {
-               Fatalf("bad alignment of keys in mapbucket for %v", t)
+               Fatalf("bad alignment of keys in bmap for %v", t)
        }
        if values.Offset%int64(valtype.Align) != 0 {
-               Fatalf("bad alignment of values in mapbucket for %v", t)
+               Fatalf("bad alignment of values in bmap for %v", t)
        }
 
        // Double-check that overflow field is final memory in struct,
        // with no padding at end. See comment above.
        if overflow.Offset != bucket.Width-int64(Widthptr) {
-               Fatalf("bad offset of overflow in mapbucket for %v", t)
+               Fatalf("bad offset of overflow in bmap for %v", t)
        }
 
        t.MapType().Bucket = bucket
@@ -229,7 +230,7 @@ func hmap(t *types.Type) *types.Type {
                return t.MapType().Hmap
        }
 
-       bmap := mapbucket(t)
+       bmap := bmap(t)
 
        // build a struct:
        // type hmap struct {
@@ -281,7 +282,7 @@ func hiter(t *types.Type) *types.Type {
        }
 
        hmap := hmap(t)
-       bmap := mapbucket(t)
+       bmap := bmap(t)
 
        // build a struct:
        // type hiter struct {
@@ -1301,7 +1302,7 @@ ok:
        case TMAP:
                s1 := dtypesym(t.Key())
                s2 := dtypesym(t.Val())
-               s3 := dtypesym(mapbucket(t))
+               s3 := dtypesym(bmap(t))
                s4 := dtypesym(hmap(t))
                ot = dcommontype(lsym, ot, t)
                ot = dsymptr(lsym, ot, s1.Linksym(), 0)
@@ -1324,7 +1325,7 @@ ok:
                        ot = duint8(lsym, ot, 0) // not indirect
                }
 
-               ot = duint16(lsym, ot, uint16(mapbucket(t).Width))
+               ot = duint16(lsym, ot, uint16(bmap(t).Width))
                ot = duint8(lsym, ot, uint8(obj.Bool2int(isreflexive(t.Key()))))
                ot = duint8(lsym, ot, uint8(obj.Bool2int(needkeyupdate(t.Key()))))
                ot = dextratype(lsym, ot, t, 0)
index e85e4ba8f5d573783d09c5681d2985a0668bb4bc..e98514255aa58915482ed59dee91388a67f8ac6f 100644 (file)
@@ -1464,7 +1464,7 @@ opswitch:
                        // are stored with an indirection. So max bucket size is 2048+eps.
 
                        // var bv bmap
-                       bv := temp(mapbucket(t))
+                       bv := temp(bmap(t))
 
                        zero = nod(OAS, bv, nil)
                        zero = typecheck(zero, Etop)