mirror of
https://github.com/golang/go.git
synced 2025-11-01 17:20:56 +00:00
cmd/compile: implement min/max builtins
Updates #59488. Change-Id: I254da7cca071eeb5af2f8aecdcd9461703fe8677 Reviewed-on: https://go-review.googlesource.com/c/go/+/496257 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
a6a25869f0
commit
b0f15b4ac0
17 changed files with 391 additions and 58 deletions
|
|
@ -525,6 +525,12 @@ func walkNew(n *ir.UnaryExpr, init *ir.Nodes) ir.Node {
|
|||
return n
|
||||
}
|
||||
|
||||
func walkMinMax(n *ir.CallExpr, init *ir.Nodes) ir.Node {
|
||||
init.Append(ir.TakeInit(n)...)
|
||||
walkExprList(n.Args, init)
|
||||
return n
|
||||
}
|
||||
|
||||
// generate code for print.
|
||||
func walkPrint(nn *ir.CallExpr, init *ir.Nodes) ir.Node {
|
||||
// Hoist all the argument evaluation up before the lock.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue