Commit 4ab1793a authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: convert asmlist to []*Node

Updates #14473.

Change-Id: I88745c2a6119dea3b81b57299e70a2a7e4c584a8
Reviewed-on: https://go-review.googlesource.com/20272
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 78374184
...@@ -27,7 +27,7 @@ func exportf(format string, args ...interface{}) { ...@@ -27,7 +27,7 @@ func exportf(format string, args ...interface{}) {
} }
} }
var asmlist *NodeList var asmlist []*Node
// Mark n's symbol as exported // Mark n's symbol as exported
func exportsym(n *Node) { func exportsym(n *Node) {
...@@ -89,7 +89,7 @@ func autoexport(n *Node, ctxt Class) { ...@@ -89,7 +89,7 @@ func autoexport(n *Node, ctxt Class) {
} }
if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 { if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 {
n.Sym.Flags |= SymAsm n.Sym.Flags |= SymAsm
asmlist = list(asmlist, n) asmlist = append(asmlist, n)
} }
} }
...@@ -565,17 +565,12 @@ func importtype(pt *Type, t *Type) { ...@@ -565,17 +565,12 @@ func importtype(pt *Type, t *Type) {
} }
func dumpasmhdr() { func dumpasmhdr() {
var b *obj.Biobuf
b, err := obj.Bopenw(asmhdr) b, err := obj.Bopenw(asmhdr)
if err != nil { if err != nil {
Fatalf("%v", err) Fatalf("%v", err)
} }
fmt.Fprintf(b, "// generated by %cg -asmhdr from package %s\n\n", Thearch.Thechar, localpkg.Name) fmt.Fprintf(b, "// generated by compile -asmhdr from package %s\n\n", localpkg.Name)
var n *Node for _, n := range asmlist {
var t *Type
for l := asmlist; l != nil; l = l.Next {
n = l.N
if isblanksym(n.Sym) { if isblanksym(n.Sym) {
continue continue
} }
...@@ -584,7 +579,7 @@ func dumpasmhdr() { ...@@ -584,7 +579,7 @@ func dumpasmhdr() {
fmt.Fprintf(b, "#define const_%s %v\n", n.Sym.Name, Vconv(n.Val(), obj.FmtSharp)) fmt.Fprintf(b, "#define const_%s %v\n", n.Sym.Name, Vconv(n.Val(), obj.FmtSharp))
case OTYPE: case OTYPE:
t = n.Type t := n.Type
if t.Etype != TSTRUCT || t.Map != nil || t.Funarg { if t.Etype != TSTRUCT || t.Map != nil || t.Funarg {
break break
} }
......
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