]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.9] cmd/compile: replace GOROOT in //line directives
authorDavid Crawshaw <crawshaw@golang.org>
Wed, 13 Sep 2017 23:04:25 +0000 (19:04 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 20:22:55 +0000 (20:22 +0000)
commit0b55d8dbfc6892433b0329b3834d50f72d90db58
tree5db32d6b273666dc9d44fd5f978490520a460d00
parent5c48811aec6fab7979edcde4de09a0d2380fb175
[release-branch.go1.9] 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>
Reviewed-on: https://go-review.googlesource.com/70975
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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