Mercurial > hg > CbC > old > device
changeset 901:8bdd5061cb8f
RSTRUCT removal (at last)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Apr 2014 11:10:41 +0900 |
parents | 8d225b0c3cf3 |
children | 11e0b8112141 |
files | mc-code-arm.c mc-code-i64.c mc-code-ia32.c mc-code-mips.c mc-code-powerpc.c mc-code-spu.c mc-codegen.c mc-inline.c mc-tree.c mc.h |
diffstat | 10 files changed, 12 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-arm.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-arm.c Tue Apr 08 11:10:41 2014 +0900 @@ -2596,8 +2596,7 @@ if (e5) { // compute address only, complex_ is me now. Clear it. complex_ = 0; e4 = car(e3); - if (car(e4)==RSTRUCT) e4 = cadr(e4); - esel if (car(e4)==INDIRECT) e4 = cadr(e4); + if (car(e4)==INDIRECT) e4 = cadr(e4); if (!simple_arg(e4)) { // Calculate complex struct address here. // If simple, leave it.
--- a/mc-code-i64.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-i64.c Tue Apr 08 11:10:41 2014 +0900 @@ -2440,8 +2440,7 @@ if (e5) { // compute address only, complex_ is me now. Clear it. complex_ = 0; e4 = car(e3); - if (car(e4)==RSTRUCT) e4 = cadr(e4); - else if (car(e4)==INDIRECT) e4 = cadr(e4); + if (car(e4)==INDIRECT) e4 = cadr(e4); if (!simple_arg(e4)) { // Calculate complex struct address here. // If simple, leave it.
--- a/mc-code-ia32.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-ia32.c Tue Apr 08 11:10:41 2014 +0900 @@ -1899,8 +1899,7 @@ if (e5) { // compute address only, complex_ is me now. Clear it. complex_ = 0; e4 = car(e3); - if (car(e4)==RSTRUCT) e4 = cadr(e4); - else if (car(e4)==INDIRECT) e4 = cadr(e4); + if (car(e4)==INDIRECT) e4 = cadr(e4); if (!simple_arg(e4)) { // Calculate complex struct address here. // If simple, leave it.
--- a/mc-code-mips.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-mips.c Tue Apr 08 11:10:41 2014 +0900 @@ -1918,7 +1918,7 @@ not_simple_p(int e3) { switch(e3) { - case FUNCTION: case CONV: case RSTRUCT: case STASS: case ALLOCA: + case FUNCTION: case CONV: case STASS: case ALLOCA: case LDIV: case LUDIV: case LMOD: case LUMOD: case LLSHIFT: case LULSHIFT: case LRSHIFT: case LURSHIFT: case DDIV: case DADD: case DSUB: case DMUL: case DMINUS:
--- a/mc-code-powerpc.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-powerpc.c Tue Apr 08 11:10:41 2014 +0900 @@ -2612,8 +2612,7 @@ if (e5) { // compute address only, complex_ is me now. Clear it. complex_ = 0; e4 = car(e3); - if (car(e4)==RSTRUCT) e4 = cadr(e4); - else if (car(e4)==INDIRECT) e4 = cadr(e4); + if (car(e4)==INDIRECT) e4 = cadr(e4); if (!simple_arg(e4)) { // Calculate complex struct address here. // If simple, leave it.
--- a/mc-code-spu.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-code-spu.c Tue Apr 08 11:10:41 2014 +0900 @@ -1735,7 +1735,6 @@ if (e5) { // compute address only, complex_ is me now. Clear it. complex_ = 0; e4 = car(e3); - if (car(e4)==RSTRUCT) e4 = cadr(e4); if (!simple_arg(cadr(e4))) { // Calculate complex struct address here. // If simple, leave it.
--- a/mc-codegen.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-codegen.c Tue Apr 08 11:10:41 2014 +0900 @@ -523,7 +523,7 @@ return t1; case STASS: sassign(e1); - return RSTRUCT; + return STRUCT; case ASS: case CASS: case SASS: assign(e1); return INT; @@ -553,9 +553,6 @@ lassop(e1); return LONGLONG ; #endif - case RSTRUCT: - g_expr0(e2); - return RSTRUCT; case ALLOCA: code_alloca(e2,USE_CREG); return list2(POINTER,CHAR); @@ -1511,7 +1508,6 @@ } else if ((ty==LONGLONG||ty==ULONGLONG) && (r = get_input_lregister_var(fregs,0,1))) { target=list5(r, target,ty,e2,0); regs+=lp64?1:2; } else if (env) { - while(car(e2)==RSTRUCT) e2=cadr(e2); /* envreg contains frame pointer, we need disp_offset. disp_offset for code segment and function should be the same value. @@ -1525,7 +1521,6 @@ ), e2,ty,ty)); } else { - while(car(e2)==RSTRUCT) e2=cadr(e2); target=list5(list3n(LVAR,0,0), target,ty,e2,0); } /* keep arg space for register variables */ @@ -1865,9 +1860,6 @@ e3 = cadr(e2); /* offset of the variable (distination) */ e4 = caddr(e1); /* right value (source) */ sz = cadddr(e1); /* size of struct or union */ - if (car(e4)==RSTRUCT) { - e4 = cadr(e4); - } if (is_same_type(e2,e4)) { if (cadr(e2)==cadr(e4)) { if (use) g_expr(e4); @@ -2454,9 +2446,9 @@ case STRUCT:case UNION: if (size(t)!=size(type)) error(TYERR); type=t; // dispose attr - if(car(e2)==RSTRUCT && car(cadr(e2))==FUNCTION) { - replace_return_struct(cadr(e2),e1); - return cadr(e2); + if(car(e2)==FUNCTION) { + replace_return_struct(e2,e1); + return e2; } else { return (list4(STASS,e1,e2,size(t))); } @@ -3947,8 +3939,7 @@ nptr0->attr = 0; nptr0->ty = t; nptr0->dsp = new_lvar_align(sz,16); // ?! - e1 = list3(RSTRUCT,list3n( - nptr0->sc,nptr0->dsp,nptr0),sz); + e1 = list3n(nptr0->sc,nptr0->dsp,nptr0); v = list3n(nptr0->sc,nptr0->dsp,nptr0); } else { e1 = 0; @@ -3958,7 +3949,7 @@ text_mode(0); if (init_vars) emit_init_vars(); - g_expr0(e1); + if (e1) g_expr0(e1); init_vars = sinit_vars; return type; } @@ -4012,7 +4003,6 @@ } switch (mode) { case GDECL: - if (car(e)==RSTRUCT) break; // already done if (!is_const(e)) error(INERR); emit_data(e,t,n); break; @@ -4396,9 +4386,8 @@ if(car(e)==INDIRECT) return cadr(e); return list2(ADDRESS,e); case STRUCT: case UNION: - if(car(e)==RSTRUCT) return e; /* to make idempotent */ if(car(e)==INDIRECT) return cadr(e); - return list3(RSTRUCT,e,cadr(type) /* size */); + return e; case FUNCTION: type=set_type_with_attr(cadr(type0),type); return e;
--- a/mc-inline.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-inline.c Tue Apr 08 11:10:41 2014 +0900 @@ -1271,9 +1271,6 @@ case BUILTIN_INFF: case BUILTIN_INFL: return e1; - case RSTRUCT: - // list3(RSTRUCT,e,size) - return pexpr(e2); case LABEL: return p_label_var(e2); case LVAR: case URLVAR:
--- a/mc-tree.c Tue Apr 08 09:57:40 2014 +0900 +++ b/mc-tree.c Tue Apr 08 11:10:41 2014 +0900 @@ -194,7 +194,6 @@ case PERIOD: *name = "."; *args=""; *order=16; break; case ARROW: *name = "->"; *args=""; *order=16; break; case SASS: *name = "sass"; *args=""; *order=-1; break; - case RSTRUCT: *name = "rstruct"; *args=""; *order=-1; break; case AS+MUL: *name = "*="; *args="ee"; *order=1; break; case AS+UMUL: *name = "*="; *args="ee"; *order=1; break; case AS+DIV: *name = "/="; *args="ee"; *order=1; break;