mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Semi-regular merge from tip into ssa branch Change-Id: Ida553b5c504058347c0bdcb1a987727bdcea456b
This commit is contained in:
commit
359747da15
493 changed files with 13243 additions and 21889 deletions
|
|
@ -302,6 +302,10 @@ func staticcopy(l *Node, r *Node, out **NodeList) bool {
|
|||
orig := r
|
||||
r = r.Name.Defn.Right
|
||||
|
||||
for r.Op == OCONVNOP {
|
||||
r = r.Left
|
||||
}
|
||||
|
||||
switch r.Op {
|
||||
case ONAME:
|
||||
if staticcopy(l, r, out) {
|
||||
|
|
@ -380,6 +384,7 @@ func staticcopy(l *Node, r *Node, out **NodeList) bool {
|
|||
rr.Orig = rr // completely separate copy
|
||||
rr.Type = ll.Type
|
||||
rr.Xoffset += e.Xoffset
|
||||
setlineno(rr)
|
||||
*out = list(*out, Nod(OAS, ll, rr))
|
||||
}
|
||||
}
|
||||
|
|
@ -394,6 +399,10 @@ func staticcopy(l *Node, r *Node, out **NodeList) bool {
|
|||
func staticassign(l *Node, r *Node, out **NodeList) bool {
|
||||
var n1 Node
|
||||
|
||||
for r.Op == OCONVNOP {
|
||||
r = r.Left
|
||||
}
|
||||
|
||||
switch r.Op {
|
||||
//dump("not static", r);
|
||||
default:
|
||||
|
|
@ -484,6 +493,7 @@ func staticassign(l *Node, r *Node, out **NodeList) bool {
|
|||
if e.Expr.Op == OLITERAL {
|
||||
gdata(&n1, e.Expr, int(n1.Type.Width))
|
||||
} else {
|
||||
setlineno(e.Expr)
|
||||
a = Nod(OXXX, nil, nil)
|
||||
*a = n1
|
||||
a.Orig = a // completely separate copy
|
||||
|
|
@ -636,6 +646,7 @@ func structlit(ctxt int, pass int, n *Node, var_ *Node, init **NodeList) {
|
|||
}
|
||||
|
||||
// build list of var.field = expr
|
||||
setlineno(value)
|
||||
a = Nod(ODOT, var_, newname(index.Sym))
|
||||
|
||||
a = Nod(OAS, a, value)
|
||||
|
|
@ -703,6 +714,7 @@ func arraylit(ctxt int, pass int, n *Node, var_ *Node, init **NodeList) {
|
|||
}
|
||||
|
||||
// build list of var[index] = value
|
||||
setlineno(value)
|
||||
a = Nod(OINDEX, var_, index)
|
||||
|
||||
a = Nod(OAS, a, value)
|
||||
|
|
@ -866,6 +878,7 @@ func slicelit(ctxt int, n *Node, var_ *Node, init **NodeList) {
|
|||
}
|
||||
|
||||
// build list of var[c] = expr
|
||||
setlineno(value)
|
||||
a = Nod(OAS, a, value)
|
||||
|
||||
typecheck(&a, Etop)
|
||||
|
|
@ -954,6 +967,7 @@ func maplit(ctxt int, n *Node, var_ *Node, init **NodeList) {
|
|||
|
||||
if isliteral(index) && isliteral(value) {
|
||||
// build vstat[b].a = key;
|
||||
setlineno(index)
|
||||
a = Nodintconst(b)
|
||||
|
||||
a = Nod(OINDEX, vstat, a)
|
||||
|
|
@ -965,6 +979,7 @@ func maplit(ctxt int, n *Node, var_ *Node, init **NodeList) {
|
|||
*init = list(*init, a)
|
||||
|
||||
// build vstat[b].b = value;
|
||||
setlineno(value)
|
||||
a = Nodintconst(b)
|
||||
|
||||
a = Nod(OINDEX, vstat, a)
|
||||
|
|
@ -1032,15 +1047,18 @@ func maplit(ctxt int, n *Node, var_ *Node, init **NodeList) {
|
|||
val = temp(var_.Type.Type)
|
||||
}
|
||||
|
||||
setlineno(r.Left)
|
||||
a = Nod(OAS, key, r.Left)
|
||||
typecheck(&a, Etop)
|
||||
walkstmt(&a)
|
||||
*init = list(*init, a)
|
||||
setlineno(r.Right)
|
||||
a = Nod(OAS, val, r.Right)
|
||||
typecheck(&a, Etop)
|
||||
walkstmt(&a)
|
||||
*init = list(*init, a)
|
||||
|
||||
setlineno(val)
|
||||
a = Nod(OAS, Nod(OINDEX, var_, key), val)
|
||||
typecheck(&a, Etop)
|
||||
walkstmt(&a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue