mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: eliminate two uses of Type.Pos
Instead we can use t.nod.Pos. Change-Id: I643ee3226e402e38d4c77e8f328cbe83e55eac5c Reviewed-on: https://go-review.googlesource.com/38309 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
e22ba7f0fb
commit
07af21308c
2 changed files with 6 additions and 2 deletions
|
|
@ -126,7 +126,7 @@ func dowidth(t *Type) {
|
||||||
if t.Width == -2 {
|
if t.Width == -2 {
|
||||||
if !t.Broke() {
|
if !t.Broke() {
|
||||||
t.SetBroke(true)
|
t.SetBroke(true)
|
||||||
yyerrorl(t.Pos, "invalid recursive type %v", t)
|
yyerrorl(t.nod.Pos, "invalid recursive type %v", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Width = 0
|
t.Width = 0
|
||||||
|
|
@ -143,7 +143,10 @@ func dowidth(t *Type) {
|
||||||
defercalc++
|
defercalc++
|
||||||
|
|
||||||
lno := lineno
|
lno := lineno
|
||||||
lineno = t.Pos
|
if t.nod != nil {
|
||||||
|
lineno = t.nod.Pos
|
||||||
|
}
|
||||||
|
|
||||||
t.Width = -2
|
t.Width = -2
|
||||||
t.Align = 0
|
t.Align = 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3822,6 +3822,7 @@ func typecheckdef(n *Node) *Node {
|
||||||
}
|
}
|
||||||
n.Walkdef = 1
|
n.Walkdef = 1
|
||||||
n.Type = typ(TFORW)
|
n.Type = typ(TFORW)
|
||||||
|
n.Type.nod = n
|
||||||
n.Type.Sym = n.Sym // TODO(gri) this also happens in typecheckdeftype(n) - where should it happen?
|
n.Type.Sym = n.Sym // TODO(gri) this also happens in typecheckdeftype(n) - where should it happen?
|
||||||
nerrors0 := nerrors
|
nerrors0 := nerrors
|
||||||
typecheckdeftype(n)
|
typecheckdeftype(n)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue