cmd/compile: break apart dumptypestructs

dumptypestructs did several different jobs.
Split them into separate functions
and call them in turn.

Hand dumptypestructs a list of dcls,
rather than reading the global.

Rename dumpptabs for (marginal) clarity.

This is groundwork for compiling autogenerated
functions concurrently.

Passes toolstash-check.

Change-Id: I627a1dffc70a7e4b7b4436ab19af1406267f01dc
Reviewed-on: https://go-review.googlesource.com/41501
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-04-23 17:35:12 -07:00
parent 07d09003f1
commit 976a5ce1a8
2 changed files with 16 additions and 7 deletions

View file

@ -136,8 +136,11 @@ func dumpobj1(outfile string, mode int) {
externs := len(externdcl)
dumpglobls()
dumpptabs()
dumptypestructs()
addptabs()
dumptypestructs(externdcl)
dumptabs()
dumpimportstrings()
dumpbasictypes()
// Dump extra globals.
tmp := externdcl
@ -171,7 +174,7 @@ func dumpobj1(outfile string, mode int) {
bout.Close()
}
func dumpptabs() {
func addptabs() {
if !Ctxt.Flag_dynlink || localpkg.Name != "main" {
return
}