1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.ssa] cmd/compile: implement OPLUS

Change-Id: Iaf282211a717e38b05e5d2661d400d465decad50
Reviewed-on: https://go-review.googlesource.com/14337
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-09-05 19:28:00 -07:00
parent 9569b957cb
commit 4178f20776

View File

@ -1599,7 +1599,7 @@ func (s *state) expr(n *Node) *ssa.Value {
s.startBlock(bResult)
return s.variable(n, Types[TBOOL])
// unary ops
// unary ops
case OMINUS:
a := s.expr(n.Left)
if n.Type.IsComplex() {
@ -1613,6 +1613,8 @@ func (s *state) expr(n *Node) *ssa.Value {
case ONOT, OCOM:
a := s.expr(n.Left)
return s.newValue1(s.ssaOp(n.Op, n.Type), a.Type, a)
case OPLUS:
return s.expr(n.Left)
case OADDR:
return s.addr(n.Left)