remove unused second parameter.
R=ken
OCL=22126
CL=22126
break;
}
- if(sudoaddable(res, n->type, &addr)) {
+ if(sudoaddable(res, &addr)) {
a = optoas(OAS, res->type);
if(f) {
regalloc(&n2, res->type, N);
goto ret;
}
- if(sudoaddable(n, res->type, &addr)) {
+ if(sudoaddable(n, &addr)) {
a = optoas(OAS, n->type);
if(res->op == OREGISTER) {
p1 = gins(a, N, res);
regalloc(&n1, nl->type, res);
cgen(nl, &n1);
- if(sudoaddable(nr, nl->type, &addr)) {
+ if(sudoaddable(nr, &addr)) {
p1 = gins(a, N, &n1);
p1->from = addr;
gmove(&n1, res);
gins(optoas(OINC, nl->type), N, nl);
goto ret;
}
- if(sudoaddable(nl, nr->type, &addr)) {
+ if(sudoaddable(nl, &addr)) {
p1 = gins(optoas(OINC, nl->type), N, N);
p1->to = addr;
sudoclean();
gins(optoas(ODEC, nl->type), N, nl);
goto ret;
}
- if(sudoaddable(nl, nr->type, &addr)) {
+ if(sudoaddable(nl, &addr)) {
p1 = gins(optoas(ODEC, nl->type), N, N);
p1->to = addr;
sudoclean();
goto ret;
}
if(nr->ullman < UINF)
- if(sudoaddable(nl, nr->type, &addr)) {
+ if(sudoaddable(nl, &addr)) {
if(smallintconst(nr)) {
p1 = gins(optoas(n->etype, nl->type), nr, N);
p1->to = addr;
int isfat(Type*);
void setmaxarg(Type*);
void sudoclean(void);
-int sudoaddable(Node*, Type*, Addr*);
+int sudoaddable(Node*, Addr*);
/*
* list.c
cleani -= 2;
}
+/*
+ * generate code to compute address of n,
+ * a reference to a (perhaps nested) field inside
+ * an array or struct.
+ * return 0 on failure, 1 on success.
+ * on success, leaves usable address in a.
+ *
+ * caller is responsible for calling sudoclean
+ * after successful sudoaddable,
+ * to release the register used for a.
+ */
int
-sudoaddable(Node *n, Type *t, Addr *a)
+sudoaddable(Node *n, Addr *a)
{
int o, i, w;
int oary[10];
Node n1, n2, *nn, *l, *r;
Node *reg, *reg1;
Prog *p1;
+ Type *t;
- if(n->type == T || t == T)
+ if(n->type == T)
return 0;
switch(n->op) {