mirror of
https://github.com/golang/go
synced 2024-11-19 11:44:45 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
783741844b
commit
4ab1793a78
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user