NodeList* reorder3(NodeList*);
NodeList* reorder4(NodeList*);
void anylit(Node*, Node*, NodeList**);
+int oaslit(Node*, NodeList**);
void heapmoves(void);
void walkdeflist(NodeList*);
void walkdef(Node*);
*init = concat(*init, n->ninit);
n->ninit = nil;
walkexpr(&n->left, init);
+ if(oaslit(n, init))
+ goto ret;
walkexpr(&n->right, init);
l = n->left;
r = n->right;
}
}
+int
+oaslit(Node *n, NodeList **init)
+{
+ Type *t;
+
+ if(n->left == N || n->right == N)
+ goto no;
+ if(!simplename(n->left))
+ goto no;
+ if(n->dodata == 1)
+ goto initctxt;
+
+no:
+ // not a special composit literal assignment
+ return 0;
+
+initctxt:
+ switch(n->right->op) {
+ default:
+ goto no;
+
+ case OSTRUCTLIT:
+ structlit(n->right, n->left, 3, init);
+ break;
+
+ case OARRAYLIT:
+ t = n->right->type;
+ if(t == T)
+ goto no;
+ if(t->bound < 0) {
+ slicelit(n->right, n->left, init);
+ break;
+ }
+ arraylit(n->right, n->left, 3, init);
+ break;
+
+ case OMAPLIT:
+ maplit(n->right, n->left, init);
+ break;
+ }
+ n->op = OEMPTY;
+ return 1;
+}
+
/*
* walk through argin parameters.
* generate and return code to allocate