[dev.inline] cmd/compile: split mkpackage into separate functions

Previously, mkpackage jumbled together three unrelated tasks: handling
package declarations, clearing imports from processing previous source
files, and assigning a default value to outfile.

Change-Id: I1e124335768aeabfd1a6d9cc2499fbb980d951cf
Reviewed-on: https://go-review.googlesource.com/35124
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2017-01-11 15:20:38 -08:00
parent 33c036867f
commit e48919bcde
3 changed files with 55 additions and 53 deletions

View file

@ -70,6 +70,8 @@ func (p *noder) file(file *syntax.File) {
// TODO(gri) fix this once we switched permanently to the new
// position information.
lineno = MakePos(file.Pos().Base(), uint(file.Lines), 0)
clearImports()
}
func (p *noder) decls(decls []syntax.Decl) (l []*Node) {