[dev.inline] cmd/internal/src: make Pos implementation abstract

Adjust cmd/compile accordingly.

This will make it easier to replace the underlying implementation.

Change-Id: I33645850bb18c839b24785b6222a9e028617addb
Reviewed-on: https://go-review.googlesource.com/34133
Reviewed-by: David Lazar <lazard@golang.org>
This commit is contained in:
Robert Griesemer 2016-12-07 16:02:42 -08:00
parent 24597c080b
commit 82d0caea2c
36 changed files with 123 additions and 93 deletions

View file

@ -40,12 +40,12 @@ func Prog(as obj.As) *obj.Prog {
Clearp(pc)
p.Link = pc
if lineno == 0 && Debug['K'] != 0 {
Warn("prog: line 0")
if !lineno.IsKnown() && Debug['K'] != 0 {
Warn("prog: unknown position (line 0)")
}
p.As = as
p.Lineno = int32(lineno) // TODO(gri) fix this
p.Lineno = int32(lineno.Line()) // TODO(gri) fix this
return p
}