Skip to content

Commit 02de5ed

Browse files
committed
cmd/internal/obj: add AddrName type and cleanup AddrType values
Passes toolstash -cmp. Change-Id: Ida3eda9bd9d79a34c1c3f18cb41aea9392698076 Reviewed-on: https://go-review.googlesource.com/36950 Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Josh Bleecher Snyder <[email protected]>
1 parent e2948f7 commit 02de5ed

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/cmd/compile/internal/gc/pgen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func gendebug(fn *obj.LSym, decls []*Node) {
442442
continue
443443
}
444444

445-
var name int16
445+
var name obj.AddrName
446446
switch n.Class {
447447
case PAUTO:
448448
if !n.Used {

src/cmd/internal/obj/link.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ type Addr struct {
157157
Index int16
158158
Scale int16 // Sometimes holds a register.
159159
Type AddrType
160-
Name int8
160+
Name AddrName
161161
Class int8
162162
Offset int64
163163
Sym *LSym
@@ -172,10 +172,10 @@ type Addr struct {
172172
Node interface{} // for use by compiler
173173
}
174174

175-
type AddrType uint8
175+
type AddrName int8
176176

177177
const (
178-
NAME_NONE = 0 + iota
178+
NAME_NONE AddrName = iota
179179
NAME_EXTERN
180180
NAME_STATIC
181181
NAME_AUTO
@@ -185,10 +185,11 @@ const (
185185
NAME_GOTREF
186186
)
187187

188-
const (
189-
TYPE_NONE AddrType = 0
188+
type AddrType uint8
190189

191-
TYPE_BRANCH AddrType = 5 + iota
190+
const (
191+
TYPE_NONE AddrType = iota
192+
TYPE_BRANCH
192193
TYPE_TEXTSIZE
193194
TYPE_MEM
194195
TYPE_CONST
@@ -691,7 +692,7 @@ type Auto struct {
691692
Asym *LSym
692693
Link *Auto
693694
Aoffset int32
694-
Name int16
695+
Name AddrName
695696
Gotype *LSym
696697
}
697698

0 commit comments

Comments
 (0)