[dev.inline] cmd/compile: introduce cmd/internal/src.Pos type for line numbers

This is a step toward chosing a different position representation.
By introducing an explicit type, it will be easier to make the
transition step-wise while ensuring everything keeps running.

This has been reviewed via https://go-review.googlesource.com/#/c/34025/.

Change-Id: Ibceddcd62d8f346321ac3250e3940e9c436ed684
Reviewed-on: https://go-review.googlesource.com/34132
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Lazar <lazard@golang.org>
This commit is contained in:
Robert Griesemer 2016-12-06 17:08:06 -08:00
parent 0be4ef3ea6
commit 24597c080b
27 changed files with 181 additions and 132 deletions

View file

@ -6,6 +6,8 @@
package gc
import "cmd/internal/src"
// A Node is a single node in the syntax tree.
// Actually the syntax tree is a syntax DAG, because there is only one
// node with Op=ONAME for a given instance of a variable x.
@ -42,7 +44,7 @@ type Node struct {
// Possibly still more uses. If you find any, document them.
Xoffset int64
Lineno int32
Lineno src.Pos
Esc uint16 // EscXXX
@ -308,8 +310,8 @@ type Func struct {
Label int32 // largest auto-generated label in this function
Endlineno int32
WBLineno int32 // line number of first write barrier
Endlineno src.Pos
WBLineno src.Pos // line number of first write barrier
Pragma Pragma // go:xxx function annotations
Dupok bool // duplicate definitions ok