mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use one format for exporting calls of builtin functions
Minor cleanup. Each of these cases appears both during export and import when running all.bash and thus is tested by all.bash. Change-Id: Iaa4a5a5b163cefe33e43d08d396e02a02e5c22a5 Reviewed-on: https://go-review.googlesource.com/23060 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
eb9062b7bf
commit
21d781070c
2 changed files with 17 additions and 19 deletions
|
|
@ -884,29 +884,18 @@ func (p *importer) node() *Node {
|
|||
n.SetSliceBounds(low, high, max)
|
||||
return n
|
||||
|
||||
case OCOPY, OCOMPLEX:
|
||||
n := builtinCall(op)
|
||||
n.List.Set([]*Node{p.expr(), p.expr()})
|
||||
return n
|
||||
|
||||
// case OCONV, OCONVIFACE, OCONVNOP, OARRAYBYTESTR, OARRAYRUNESTR, OSTRARRAYBYTE, OSTRARRAYRUNE, ORUNESTR:
|
||||
// unreachable - mapped to OCONV case below by exporter
|
||||
|
||||
case OCONV:
|
||||
n := Nod(OCALL, typenod(p.typ()), nil)
|
||||
if p.bool() {
|
||||
n.List.Set1(p.expr())
|
||||
} else {
|
||||
n.List.Set(p.exprList())
|
||||
}
|
||||
n.List.Set(p.exprList())
|
||||
return n
|
||||
|
||||
case OREAL, OIMAG, OAPPEND, OCAP, OCLOSE, ODELETE, OLEN, OMAKE, ONEW, OPANIC, ORECOVER, OPRINT, OPRINTN:
|
||||
case OCOPY, OCOMPLEX, OREAL, OIMAG, OAPPEND, OCAP, OCLOSE, ODELETE, OLEN, OMAKE, ONEW, OPANIC, ORECOVER, OPRINT, OPRINTN:
|
||||
n := builtinCall(op)
|
||||
if p.bool() {
|
||||
n.List.Set1(p.expr())
|
||||
} else {
|
||||
n.List.Set(p.exprList())
|
||||
n.List.Set(p.exprList())
|
||||
if op == OAPPEND {
|
||||
n.Isddd = p.bool()
|
||||
}
|
||||
return n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue