go/src/cmd
Josh Bleecher Snyder 165a96e281 cmd/compile: fix pos of typenames created during SSA construction
Prior to this CL, the function's position was used.
The dottype Node's position is clearly better.

I'm not thrilled about introducing a reference to
lineno in the middle of SSA construction;
I will have to remove it later.
My immediate goal is stability and correctness of positions,
though, since that aids refactoring, so this is an improvement.

An example from package io:

func (t *multiWriter) WriteString(s string) (n int, err error) {
	var p []byte // lazily initialized if/when needed
	for _, w := range t.writers {
		if sw, ok := w.(stringWriter); ok {
			n, err = sw.WriteString(s)

The w.(stringWriter) type assertion includes loading
the address of static type data for stringWriter:

LEAQ	type."".stringWriter(SB), R10

Prior to this CL, this instruction was given the line number
of the function declaration.
After this CL, this instruction is given the line number
of the type assertion itself.

Change-Id: Ifcca274b581a5a57d7e3102c4d7b7786bf307210
Reviewed-on: https://go-review.googlesource.com/38389
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-03-21 04:14:26 +00:00
..
addr2line
api api: promote next.txt to go1.8.txt, update go tool 2016-12-01 02:54:21 +00:00
asm cmd/internal/obj: convert Debug* Link fields into bools 2017-03-20 22:08:41 +00:00
cgo cmd/cgo: don't track same node twice in guessKinds 2017-02-02 17:20:37 +00:00
compile cmd/compile: fix pos of typenames created during SSA construction 2017-03-21 04:14:26 +00:00
cover cmd/cover: fix spelling mistake 2016-12-20 04:45:25 +00:00
dist cmd/dist, cmd/compile: eliminate mergeEnvLists copies 2017-03-02 22:26:23 +00:00
doc cmd/doc: truncate long lists of arguments 2017-02-24 10:52:50 +00:00
fix
go cmd/go, cmd/compile: always optimize when building runtime 2017-03-20 20:54:19 +00:00
gofmt cmd/gofmt: clarify doc string even more 2017-03-20 20:13:34 +00:00
internal cmd/internal/obj: remove unneeded Addr.Node and Prog.Opt fields 2017-03-20 23:49:29 +00:00
link cmd/link: on PPC64, put plt stubs at beginning of Textp 2017-03-15 16:19:27 +00:00
nm all: fix some printf format strings 2017-02-14 02:09:30 +00:00
objdump cmd/objdump: make test independent of inlining 2017-02-19 21:27:16 +00:00
pack
pprof cmd/pprof: use proxy from environment 2017-03-19 05:45:51 +00:00
trace cmd/trace: traces may end with pending mark assists 2017-03-02 18:33:54 +00:00
vendor cmd/vendor/github.com/google/pprof: refresh from upstream 2017-03-01 21:36:03 +00:00
vet cmd/vet: check shift calculations with "unsafe" package 2017-03-13 22:30:27 +00:00