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

[dev.ssa] cmd/compile: implement OSPTR

Change-Id: Iaa40f14a1e3e4393af3c446953ffc315e79a3762
Reviewed-on: https://go-review.googlesource.com/13581
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-08-12 10:12:14 -07:00
parent d56d2fa206
commit a2d1580fdb

View File

@ -1268,6 +1268,14 @@ func (s *state) expr(n *Node) *ssa.Value {
return s.constInt(Types[TINT], n.Left.Type.Bound)
}
case OSPTR:
a := s.expr(n.Left)
if n.Left.Type.IsSlice() {
return s.newValue1(ssa.OpSlicePtr, n.Type, a)
} else {
return s.newValue1(ssa.OpStringPtr, n.Type, a)
}
case OITAB:
a := s.expr(n.Left)
return s.newValue1(ssa.OpITab, n.Type, a)