Mercurial > hg > CbC > old > device
changeset 902:11e0b8112141
final fix for RSTRUCT
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Apr 2014 11:24:16 +0900 |
parents | 8bdd5061cb8f |
children | b885e393a2bd |
files | Changes mc-parse.c mc-tree.c |
diffstat | 3 files changed, 10 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/Changes Tue Apr 08 11:10:41 2014 +0900 +++ b/Changes Tue Apr 08 11:24:16 2014 +0900 @@ -10017,7 +10017,7 @@ Sat Apr 5 11:36:03 JST 2014 -やっぱりRSTUCTなくすべきだろ? +やっぱりRSTRUCTなくすべきだろ? } else if((t=car(type))==ARRAY) { type=list2(POINTER,cadr(type)); @@ -10041,5 +10041,7 @@ zfill の最適化が足りない。 - - +Tue Apr 8 11:14:12 JST 2014 + +RSTRUCT をやっと消せた… +
--- a/mc-parse.c Tue Apr 08 11:10:41 2014 +0900 +++ b/mc-parse.c Tue Apr 08 11:24:16 2014 +0900 @@ -3183,16 +3183,16 @@ e = expr(0); if ((car(type)==STRUCT || car(type)==UNION)&& size(type)==cadr(struct_return)) { - if(car(e)==RSTRUCT && car(cadr(e))==FUNCTION) { + if(car(e)==FUNCTION) { /* CASCADING struct return */ /* return struct_return_f(); case */ /* pass the return pointer to the called function */ - replace_return_struct(cadr(e), + replace_return_struct(e, rvalue_t(car(struct_return),caddr(struct_return))); if (inmode) { - parse = list3(ST_RETURN,parse,cadr(e)); + parse = list3(ST_RETURN,parse,e); } else - gexpr(cadr(e),0); + gexpr(e,0); } else { type = caddr(struct_return); // e1 = rvalue_t(cadr(struct_return),INT); /* size */ @@ -3739,8 +3739,6 @@ case INDIRECT: e=cadr(e); break; - case RSTRUCT: - e=cadr(e); case DREGISTER: /* should be error? */ case FREGISTER: case LREGISTER: @@ -4156,11 +4154,10 @@ int local_offset; if (mode==GDECL||inmode) { int e2,e3; - int sz = size(type); e2 = list3n(GVAR,0,nptr0); e3 = decl_data_field(type,e2,0); if (!inmode) { - e1 = list3(RSTRUCT,e2,sz); + e1 = e2; } else { e1 = reverse0(e3); e1 = list3(DECL_DATA,e1,t);