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{}) {
}
}
var asmlist *NodeList
var asmlist []*Node
// Mark n's symbol as exported
func exportsym(n *Node) {
......@@ -89,7 +89,7 @@ func autoexport(n *Node, ctxt Class) {
}
if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 {
n.Sym.Flags |= SymAsm
asmlist = list(asmlist, n)
asmlist = append(asmlist, n)
}
}
......@@ -565,17 +565,12 @@ func importtype(pt *Type, t *Type) {
}
func dumpasmhdr() {
var b *obj.Biobuf
b, err := obj.Bopenw(asmhdr)
if err != nil {
Fatalf("%v", err)
}
fmt.Fprintf(b, "// generated by %cg -asmhdr from package %s\n\n", Thearch.Thechar, localpkg.Name)
var n *Node
var t *Type
for l := asmlist; l != nil; l = l.Next {
n = l.N
fmt.Fprintf(b, "// generated by compile -asmhdr from package %s\n\n", localpkg.Name)
for _, n := range asmlist {
if isblanksym(n.Sym) {
continue
}
......@@ -584,7 +579,7 @@ func dumpasmhdr() {
fmt.Fprintf(b, "#define const_%s %v\n", n.Sym.Name, Vconv(n.Val(), obj.FmtSharp))
case OTYPE:
t = n.Type
t := n.Type
if t.Etype != TSTRUCT || t.Map != nil || t.Funarg {
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