mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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:
parent
33c036867f
commit
e48919bcde
3 changed files with 55 additions and 53 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue