}
if(n == N || n->type == T)
return;
+
+ lno = dynlineno;
+ if(n->op != ONAME)
+ dynlineno = n->lineno; // for diagnostics
+
if(res == N || res->type == T)
fatal("cgen: res nil");
if(n->ullman >= UINF) {
if(n->op == OINDREG)
fatal("cgen: this is going to misscompile");
- if(res->ullman >= UINF)
- fatal("cgen: fun both sides");
+ if(res->ullman >= UINF) {
+ dump("fncalls", n);
+ fatal("cgen: node and result functions");
+ }
}
- lno = dynlineno;
- if(n->op != ONAME)
- dynlineno = n->lineno; // for diagnostics
-
if(isfat(n->type)) {
sgen(n, res, n->type->width);
goto ret;
nr = n->right;
if(nl != N && nl->ullman >= UINF)
if(nr != N && nr->ullman >= UINF) {
+ dump("fncalls", n);
fatal("cgen: both sides functions");
goto ret;
}
fp = structfirst(&flist, getoutarg(t));
if(fp == T)
- fatal("cgen_aret: nil");
+ fatal("cgen_callret: nil");
memset(&nod, 0, sizeof(nod));
nod.op = OINDREG;
Type *fp, *t;
Iter flist;
-fatal("cgen_aret");
-
t = n->left->type;
- if(t->etype == TPTR32 || t->etype == TPTR64)
+ if(isptr[t->etype])
t = t->type;
fp = structfirst(&flist, getoutarg(t));
if(fp == T)
fatal("cgen_aret: nil");
-/* gins LEA */
+
memset(&nod1, 0, sizeof(nod1));
nod1.op = OINDREG;
nod1.val.vval = D_SP;
case OI2S:
case OI2I:
case OCALL:
+ case OCALLMETH:
+ case OCALLINTER:
ul = UINF;
goto out;
}
if(top != Erv)
goto nottop;
n->addable = 1;
- ullmancalc(n);
goto ret;
case ONONAME:
if(top == Etop)
goto nottop;
n->addable = 1;
- ullmancalc(n);
if(n->type == T) {
s = n->sym;
if(s->undef == 0) {
if(top == Elv)
goto nottop;
- n->ullman = UINF;
if(n->type != T)
goto ret;
walktype(n->left, Erv);
if(n->left == N)
goto ret;
-
t = n->left->type;
if(t == T)
goto ret;
break;
case OCALLMETH:
- // add this-pointer to the arg list
- // this is bad - if not a simple
- // should make a temp copy rather
- // than recalculate it.
l = ascompatte(n->op, getinarg(t), &n->right, 0);
r = ascompatte(n->op, getthis(t), &n->left->left, 0);
if(l != N)
r = nod(OLIST, r, l);
+ n->left->left = N;
+ ullmancalc(n->left);
n->right = reorder1(r);
break;
}
if(n->left == N)
goto ret;
evconst(n);
- ullmancalc(n);
if(n->op == OLITERAL)
goto ret;
break;