commit 8ff88be8db94a21d58ecc3a5b103d92f47005346
parent 172d33e6b7c9992c1cbeb311fe7471fce448bcd7
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 7 Dec 2024 13:44:26 +0100
cc2/z80: Remove ret parameter
This was a premature optimization that was removed long time ago
from the qbe port but it still remained in the z80 port.
Diffstat:
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/cmd/scc-cc/cc2/z80-scc/cgen.c b/src/cmd/scc-cc/cc2/z80-scc/cgen.c
@@ -11,17 +11,17 @@ swtch(Node *idx)
}
static Node *
-rhs(Node *np, Node *ret)
+rhs(Node *np)
{
}
static Node *
-field(Node *np, Node *ret, int islhs)
+field(Node *np, int islhs)
{
}
static Node *
-lhs(Node *np, Node *new)
+lhs(Node *np)
{
switch (np->op) {
case OMEM:
@@ -29,9 +29,9 @@ lhs(Node *np, Node *new)
*new = *np;
return new;
case OPTR:
- return rhs(np->left, new);
+ return rhs(np->left);
case OFIELD:
- return field(np, new, 1);
+ return field(np, 1);
default:
abort();
}
@@ -63,7 +63,7 @@ bool(Node *np, Symbol *true, Symbol *false)
default:
label2node(&ifyes, true);
label2node(&ifno, false);
- code(ASBRANCH, rhs(np, &ret), &ifyes, &ifno);
+ code(ASBRANCH, rhs(np), &ifyes, &ifno);
break;
}
}
@@ -86,16 +86,14 @@ cgen(Node *np)
bool(np->left, np->u.sym, next->label);
break;
case ORET:
- p = np->left;
- if (p)
- p = rhs(np->left, &aux);
+ p = (np->left) ? rhs(np->left) : NULL;
code(ASRET, NULL, p, NULL);
break;
case OBSWITCH:
- swtch(rhs(np->left, &aux));
+ swtch(rhs(np->left);
break;
default:
- rhs(np, &aux);
+ rhs(np);
break;
}
return NULL;