comparison mc-inline.c @ 712:bf94c295d763 compiler-64bit

*** empty log message ***
author kono
date Sat, 27 Oct 2007 23:20:44 +0900
parents 35e6841ba01a
children 88e364604533
comparison
equal deleted inserted replaced
711:35e6841ba01a 712:bf94c295d763
897 // should consider int k=some_compile_time_constant; 897 // should consider int k=some_compile_time_constant;
898 static int 898 static int
899 p_decl(int e) 899 p_decl(int e)
900 { 900 {
901 // list4(ST_DECL,parse,(int)n,list3(mode,stmode,ctmode),init); 901 // list4(ST_DECL,parse,(int)n,list3(mode,stmode,ctmode),init);
902 int ctmode=cadddr(e); 902 int ctmode=caddr(e);
903 NMTBL *n=(NMTBL*)caddr(e); 903 NMTBL *n=ncaddddr(e);
904 int dsp = n->dsp; 904 int dsp = n->dsp;
905 int v=0; 905 int v=0;
906 int sstmode = stmode; 906 int sstmode = stmode;
907 int smode = mode; 907 int smode = mode;
908 int save_init_vars = init_vars; 908 int save_init_vars = init_vars;
909 int init = caddddr(e); // variable initialization 909 int init = cadddr(e); // variable initialization
910 910
911 init_vars = 0; 911 init_vars = 0;
912 // in real partial evaluation, we have to check whether this variable 912 // in real partial evaluation, we have to check whether this variable
913 // is used or not. 913 // is used or not.
914 if (ctmode) { 914 if (ctmode) {
961 v = list3n(LVAR,new_lvar(size(n->ty)),n); 961 v = list3n(LVAR,new_lvar(size(n->ty)),n);
962 } 962 }
963 if (n->sc!=FLABEL) 963 if (n->sc!=FLABEL)
964 inline_lvars = glist2(v,inline_lvars); 964 inline_lvars = glist2(v,inline_lvars);
965 if (heap[pdisp+dsp]) { 965 if (heap[pdisp+dsp]) {
966 fprintf(stderr,"## double p_decl %s %s\n",((NMTBL*)(caddr(heap[pdisp+dsp])))->nm,n->nm); 966 fprintf(stderr,"## double p_decl %s %s\n",(ncaddr(heap[pdisp+dsp]))->nm,n->nm);
967 error(-1); 967 error(-1);
968 } 968 }
969 heap[pdisp+dsp]=v; 969 heap[pdisp+dsp]=v;
970 stmode = sstmode; 970 stmode = sstmode;
971 mode = smode; 971 mode = smode;
1543 if (!fargtype) { 1543 if (!fargtype) {
1544 goto no_args; // wrong number of arguments 1544 goto no_args; // wrong number of arguments
1545 } 1545 }
1546 1546
1547 for (e3 = e5 = reverse0(caddr(e)); e3; e3 = cadr(e3)) { 1547 for (e3 = e5 = reverse0(caddr(e)); e3; e3 = cadr(e3)) {
1548 anptr = (NMTBL*)caddr(fargtype); 1548 anptr = ncadddr(fargtype);
1549 if (!anptr) break; // should not happen? 1549 if (!anptr) break; // should not happen?
1550 t=caddr(e3); // type 1550 t=caddr(e3); // type
1551 e4 = car(e3); 1551 e4 = car(e3);
1552 if (replace) { 1552 if (replace) {
1553 heap[pdisp+narg]=reference(e4); 1553 heap[pdisp+narg]=reference(e4);
1573 1573
1574 static void 1574 static void
1575 leave_inline(int e1,int toplevel) 1575 leave_inline(int e1,int toplevel)
1576 { 1576 {
1577 NMTBL *n; 1577 NMTBL *n;
1578 NMTBL *local_statics = (NMTBL*)cadddr(e1); // local static list 1578 NMTBL *local_statics = ncadddr(e1); // local static list
1579 1579
1580 if (retcont && !toplevel) error(STERR); 1580 if (retcont && !toplevel) error(STERR);
1581 // inline can't handle return/environment except top level 1581 // inline can't handle return/environment except top level
1582 1582
1583 if (local_statics && local_statics != &null_nptr) { 1583 if (local_statics && local_statics != &null_nptr) {