Commit 4a174ee4 authored by Dave Cheney's avatar Dave Cheney

cmd/internal/gc: make Node.Readonly a bool

Convert Node.Readonly to a bool.

Change-Id: Ide9f6f657f498d70d7b9544a38046325d7c82dc8
Reviewed-on: https://go-review.googlesource.com/6809Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 4b633781
...@@ -208,7 +208,7 @@ func ggloblnod(nam *Node) { ...@@ -208,7 +208,7 @@ func ggloblnod(nam *Node) {
p.To.Sym = nil p.To.Sym = nil
p.To.Type = obj.TYPE_CONST p.To.Type = obj.TYPE_CONST
p.To.Offset = nam.Type.Width p.To.Offset = nam.Type.Width
if nam.Readonly != 0 { if nam.Readonly {
p.From3.Offset = obj.RODATA p.From3.Offset = obj.RODATA
} }
if nam.Type != nil && !haspointers(nam.Type) { if nam.Type != nil && !haspointers(nam.Type) {
......
...@@ -521,7 +521,7 @@ func staticname(t *Type, ctxt int) *Node { ...@@ -521,7 +521,7 @@ func staticname(t *Type, ctxt int) *Node {
statuniqgen++ statuniqgen++
n := newname(Lookup(namebuf)) n := newname(Lookup(namebuf))
if ctxt == 0 { if ctxt == 0 {
n.Readonly = 1 n.Readonly = true
} }
addvar(n, t, PEXTERN) addvar(n, t, PEXTERN)
return n return n
......
...@@ -45,7 +45,7 @@ type Node struct { ...@@ -45,7 +45,7 @@ type Node struct {
Initorder uint8 Initorder uint8
Used uint8 Used uint8
Isddd uint8 Isddd uint8
Readonly uint8 Readonly bool
Implicit uint8 Implicit uint8
Addrtaken uint8 // address taken, even if not moved to heap Addrtaken uint8 // address taken, even if not moved to heap
Assigned uint8 // is the variable ever assigned to Assigned uint8 // is the variable ever assigned to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment