cmd/compile: record original and absolute file names for line directives

Also, with this change, error locations don't print absolute positions
in [] brackets following positions relative to line directives. To get
the absolute positions as well, specify the -L flag.

Fixes #22660.

Change-Id: I9ecfa254f053defba9c802222874155fa12fee2c
Reviewed-on: https://go-review.googlesource.com/77090
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
griesemer 2017-11-10 11:38:51 -08:00 committed by Robert Griesemer
parent 2c00dea18b
commit ca2a886cba
12 changed files with 83 additions and 27 deletions

View file

@ -93,7 +93,7 @@ func hcrash() {
}
func linestr(pos src.XPos) string {
return Ctxt.OutermostPos(pos).Format(Debug['C'] == 0)
return Ctxt.OutermostPos(pos).Format(Debug['C'] == 0, Debug['L'] == 1)
}
// lasterror keeps track of the most recently issued error.