Mercurial > hg > CbC > old > device
changeset 830:ff5dfee80829
INDIRECT handling in pexpr
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 03 Dec 2010 09:18:29 +0900 |
parents | d5dfc30826ba |
children | a22aabb27786 |
files | mc-codegen.c mc-inline.c |
diffstat | 2 files changed, 14 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-codegen.c Thu Dec 02 10:04:35 2010 +0900 +++ b/mc-codegen.c Fri Dec 03 09:18:29 2010 +0900 @@ -1796,7 +1796,7 @@ return(list2(ADDRESS, list3n(LVAR,cadr(cadr(e1))+cadr(e), ncaddr(cadr(e1))))); - case INDIRECT: + // case INDIRECT: case PERIOD: case ARROW: if (lp64) return list3(LADD,e1,llist2(LCONST,cadr(e))); @@ -3166,7 +3166,7 @@ mode = smode; return e; } - switch (car(e)%SOP){ + switch (OP(car(e))){ // special cases case ARROW: case PERIOD: @@ -3174,7 +3174,7 @@ case LVAR: case RLVAR:case URLVAR: case GVAR: case RGVAR:case URGVAR: return (e>gfree)?glist3(car(e),cadr(e),caddr(e)):e; - case INDIRECT: case RINDIRECT: + case INDIRECT: // case RINDIRECT: return glist2(car(e),copy_expr(cadr(e))); } if (LIST_ARGS(car(e))){
--- a/mc-inline.c Thu Dec 02 10:04:35 2010 +0900 +++ b/mc-inline.c Fri Dec 03 09:18:29 2010 +0900 @@ -527,9 +527,9 @@ if (type0>0 && car(type0)==POINTER) type=set_type_with_attr(cadr(type),type); if (car(lvar=cadr(e))==IVAR) { - lvar=p_lvar(cadr(e)); // can be anything.... - switch(car(lvar)) { - case LVAR: + lvar=p_lvar(cadr(e)); // can be anything.... + switch(car(lvar)) { + case LVAR: type = cadddr(e); return rvalue(lvar); case REGISTER: case DREGISTER: @@ -538,9 +538,12 @@ // should do type check if (offset) error(-1); return lvar; + default: + error(-1); } } - return list3(car(e),pexpr(cadr(e)),offset); + int e2 = pexpr(cadr(e)); + return list3(car(e),e2,offset); #endif } @@ -550,7 +553,11 @@ //int lvar; //if (car(lvar=cadr(e))==IVAR) // lvar=p_lvar(cadr(e)); // can be anything.... +#if 0 + return pexpr(cadr(e)); +#else return list3(car(e),pexpr(cadr(e)),caddr(e)); +#endif } static int