Mercurial > hg > CbC > old > device
changeset 519:b6eb97f0c11d
*** empty log message ***
author | kono |
---|---|
date | Mon, 26 Dec 2005 19:54:10 +0900 |
parents | 9f2d6aea201f |
children | c562d1681275 |
files | mc-codegen.c mc-inline.c test/longcode.c test/too-long-argument.c |
diffstat | 4 files changed, 74 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-codegen.c Mon Dec 26 12:29:10 2005 +0900 +++ b/mc-codegen.c Mon Dec 26 19:54:10 2005 +0900 @@ -909,7 +909,7 @@ /* source (after) list2(tag,disp) */ /* source list list3(e,cdr,sz) */ -#define DEBUG_PARALLEL_ASSIGN 0 +#define DEBUG_PARALLEL_ASSIGN 3 /* overlap return list of overlapped target
--- a/mc-inline.c Mon Dec 26 12:29:10 2005 +0900 +++ b/mc-inline.c Mon Dec 26 19:54:10 2005 +0900 @@ -585,7 +585,7 @@ case EXTRN: case EXTRN1: case STATIC: return pexpr(cadr(e)); default: - v = list3(LVAR,new_lvar(size(n->dsp)),(int)n); + v = list3(LVAR,new_lvar(size(n->ty)),(int)n); } if (heap[pdisp+dsp]) error(-1); heap[pdisp+dsp]=v; @@ -999,7 +999,7 @@ NMTBL *n = (NMTBL*)cadr(cadr(e)); int e1 = attr_value(n,INLINE); int parse = car(e1); // inline parse tree - int arg_disp = cadr(e1); // size of local variable + int arg_disp = cadr(e1); // number of arguments int e2,e3,t,e4,dots; int ret_type = function_type(cadddr(e),&dots);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/longcode.c Mon Dec 26 19:54:10 2005 +0900 @@ -0,0 +1,50 @@ + +typedef struct teki { + float x; + float y; + float sx; + float sy; + int charno; + char tama; + char f; + int p; + int move; + int sc; + int dt1; + int dt2; +} teki; + + + +typedef struct player { + int x; + int y; + int ch; + int point; + char bf; + int muteki; + int zanki; + int ccount; +} player; + +code +put_enemy_bung( + code(*junction)(int,teki *,player,struct move_interface), + int tekino, + teki *enemy, + player jiki, + struct move_interface interface); + +code +move13_1(int tekino,teki *enemy,player jiki,struct move_interface interface); + +code +move13(int tekino,teki *enemy,player jiki,struct move_interface interface) +{ + if (enemy[keyenemyno].f == 0 ) { + + goto put_enemy_bung(move13_1,tekino,enemy,jiki,interface); + } + goto move13_1(tekino,enemy,jiki,interface); +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/too-long-argument.c Mon Dec 26 19:54:10 2005 +0900 @@ -0,0 +1,21 @@ +code +tcode1(f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff,ret,env) + int f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff; + code(*ret)(int); + void *env; +{ + goto ret(0),env; +} + +code +tcode0(int x,int y,code(*junction)(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,code(*)(int),void *),code(*ret)(int),void *env) +{ + + goto junction(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,ret,env); +} + +int +main() +{ + goto tcode0(0,1,tcode1,return,environment); +}