]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj: add AddrName type and cleanup AddrType values
authorMatthew Dempsky <mdempsky@google.com>
Mon, 13 Feb 2017 21:34:30 +0000 (13:34 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 13 Feb 2017 21:56:17 +0000 (21:56 +0000)
Passes toolstash -cmp.

Change-Id: Ida3eda9bd9d79a34c1c3f18cb41aea9392698076
Reviewed-on: https://go-review.googlesource.com/36950
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/pgen.go
src/cmd/internal/obj/link.go

index e612cf6a334ecbc1dc8565f9f0baeb80151d5d91..519cf02f2789695be15acd2ee16e45332877c657 100644 (file)
@@ -442,7 +442,7 @@ func gendebug(fn *obj.LSym, decls []*Node) {
                        continue
                }
 
-               var name int16
+               var name obj.AddrName
                switch n.Class {
                case PAUTO:
                        if !n.Used {
index f81e1e2ef61fb7f214584b74e11e9050d3160e96..7f588b93562e8ae19db3a77ac042af20dbe14f25 100644 (file)
@@ -157,7 +157,7 @@ type Addr struct {
        Index  int16
        Scale  int16 // Sometimes holds a register.
        Type   AddrType
-       Name   int8
+       Name   AddrName
        Class  int8
        Offset int64
        Sym    *LSym
@@ -172,10 +172,10 @@ type Addr struct {
        Node interface{} // for use by compiler
 }
 
-type AddrType uint8
+type AddrName int8
 
 const (
-       NAME_NONE = 0 + iota
+       NAME_NONE AddrName = iota
        NAME_EXTERN
        NAME_STATIC
        NAME_AUTO
@@ -185,10 +185,11 @@ const (
        NAME_GOTREF
 )
 
-const (
-       TYPE_NONE AddrType = 0
+type AddrType uint8
 
-       TYPE_BRANCH AddrType = 5 + iota
+const (
+       TYPE_NONE AddrType = iota
+       TYPE_BRANCH
        TYPE_TEXTSIZE
        TYPE_MEM
        TYPE_CONST
@@ -691,7 +692,7 @@ type Auto struct {
        Asym    *LSym
        Link    *Auto
        Aoffset int32
-       Name    int16
+       Name    AddrName
        Gotype  *LSym
 }