]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: replace GOROOT in //line directives
authorDavid Crawshaw <crawshaw@golang.org>
Wed, 13 Sep 2017 23:04:25 +0000 (19:04 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Fri, 15 Sep 2017 17:18:43 +0000 (17:18 +0000)
commit27e80f7c4d8001598367e15a1617fa524bd0fb11
tree30eaac4762d4fd16c635ef629f358d2b7bdc09fa
parentaf860838123548e67232373d86453cdc4838e9d6
cmd/compile: replace GOROOT in //line directives

The compiler replaces any path of the form /path/to/goroot/src/net/port.go
with GOROOT/src/net/port.go so that the same object file is
produced if the GOROOT is moved. It was skipping this transformation
for any absolute path into the GOROOT that came from //line directives,
such as those generated by cmd/cgo.

Fixes #21373
Fixes #21720
Fixes #21825

Change-Id: I2784c701b4391cfb92e23efbcb091a84957d61dd
Reviewed-on: https://go-review.googlesource.com/63693
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/syntax/nodes_test.go
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/syntax/parser_test.go
src/cmd/compile/internal/syntax/printer_test.go
src/cmd/compile/internal/syntax/syntax.go
src/cmd/internal/objabi/line.go