[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

@ -300,7 +300,7 @@ func Main() {
blockgen = 1
dclcontext = PEXTERN
nerrors = 0
lexlineno = 1
lexlineno = src.MakePos(1)
timings.Start("fe", "loadsys")
loadsys()
@ -320,11 +320,11 @@ func Main() {
// Instead of converting EOF into '\n' in getc and count it as an extra line
// for the line history to work, and which then has to be corrected elsewhere,
// just add a line here.
lexlineno++
lexlineno = src.MakePos(lexlineno.Line() + 1)
linehistpop()
}
timings.Stop()
timings.AddEvent(int64(lexlineno-lexlineno0), "lines")
timings.AddEvent(int64(lexlineno.Line()-lexlineno0.Line()), "lines")
testdclstack()
mkpackage(localpkg.Name) // final import not used checks