mirror of
https://github.com/golang/go.git
synced 2025-11-01 09:10:57 +00:00
cmd/compile: implement unsafe.Add and unsafe.Slice
Updates #19367. Updates #40481. Change-Id: Iabd2afdd0d520e5d68fd9e6dedd013335a4b3886 Reviewed-on: https://go-review.googlesource.com/c/go/+/312214 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Trust: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
0d32d9e8a8
commit
fadad851a3
20 changed files with 439 additions and 204 deletions
|
|
@ -117,12 +117,17 @@ func walkExpr1(n ir.Node, init *ir.Nodes) ir.Node {
|
|||
n.X = walkExpr(n.X, init)
|
||||
return n
|
||||
|
||||
case ir.OEFACE, ir.OAND, ir.OANDNOT, ir.OSUB, ir.OMUL, ir.OADD, ir.OOR, ir.OXOR, ir.OLSH, ir.ORSH:
|
||||
case ir.OEFACE, ir.OAND, ir.OANDNOT, ir.OSUB, ir.OMUL, ir.OADD, ir.OOR, ir.OXOR, ir.OLSH, ir.ORSH,
|
||||
ir.OUNSAFEADD:
|
||||
n := n.(*ir.BinaryExpr)
|
||||
n.X = walkExpr(n.X, init)
|
||||
n.Y = walkExpr(n.Y, init)
|
||||
return n
|
||||
|
||||
case ir.OUNSAFESLICE:
|
||||
n := n.(*ir.BinaryExpr)
|
||||
return walkUnsafeSlice(n, init)
|
||||
|
||||
case ir.ODOT, ir.ODOTPTR:
|
||||
n := n.(*ir.SelectorExpr)
|
||||
return walkDot(n, init)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue