mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: remove a bunch of uses of typenod
Passes toolstash-check -all. Change-Id: Ic9eb0c52bedac185ab86cc62207f199d93700344 Reviewed-on: https://go-review.googlesource.com/39795 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
25fc842f17
commit
2e1b42a814
4 changed files with 22 additions and 20 deletions
|
|
@ -884,13 +884,11 @@ func (p *importer) node() *Node {
|
|||
// again. Re-introduce explicit uintptr(c) conversion.
|
||||
// (issue 16317).
|
||||
if typ.IsUnsafePtr() {
|
||||
conv := nod(OCALL, typenod(Types[TUINTPTR]), nil)
|
||||
conv.List.Set1(n)
|
||||
n = conv
|
||||
n = nod(OCONV, n, nil)
|
||||
n.Type = Types[TUINTPTR]
|
||||
}
|
||||
conv := nod(OCALL, typenod(typ), nil)
|
||||
conv.List.Set1(n)
|
||||
n = conv
|
||||
n = nod(OCONV, n, nil)
|
||||
n.Type = typ
|
||||
}
|
||||
return n
|
||||
|
||||
|
|
@ -963,10 +961,9 @@ func (p *importer) node() *Node {
|
|||
case ODOTTYPE:
|
||||
n := nodl(p.pos(), ODOTTYPE, p.expr(), nil)
|
||||
if p.bool() {
|
||||
n.Right = p.expr()
|
||||
} else {
|
||||
n.Right = typenod(p.typ())
|
||||
Fatalf("impossible")
|
||||
}
|
||||
n.Type = p.typ()
|
||||
return n
|
||||
|
||||
// case OINDEX, OINDEXMAP, OSLICE, OSLICESTR, OSLICEARR, OSLICE3, OSLICE3ARR:
|
||||
|
|
@ -989,8 +986,13 @@ func (p *importer) node() *Node {
|
|||
// unreachable - mapped to OCONV case below by exporter
|
||||
|
||||
case OCONV:
|
||||
n := nodl(p.pos(), OCALL, typenod(p.typ()), nil)
|
||||
n.List.Set(p.exprList())
|
||||
n := nodl(p.pos(), OCONV, nil, nil)
|
||||
n.Type = p.typ()
|
||||
exprs := p.exprList()
|
||||
if len(exprs) != 1 {
|
||||
Fatalf("impossible")
|
||||
}
|
||||
n.Left = exprs[0]
|
||||
return n
|
||||
|
||||
case OCOPY, OCOMPLEX, OREAL, OIMAG, OAPPEND, OCAP, OCLOSE, ODELETE, OLEN, OMAKE, ONEW, OPANIC, ORECOVER, OPRINT, OPRINTN:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue