comparison mc-inline.c @ 528:d6fff671793a

minor fix inline
author kono
date Thu, 29 Dec 2005 01:10:01 +0900
parents 6b0fd56848e6
children ad874ef77dde
comparison
equal deleted inserted replaced
527:6b0fd56848e6 528:d6fff671793a
587 int dsp = n->dsp; 587 int dsp = n->dsp;
588 int v; 588 int v;
589 // in real partial evaluation, we have to check whether this variable 589 // in real partial evaluation, we have to check whether this variable
590 // is used or not. 590 // is used or not.
591 switch(stmode) { 591 switch(stmode) {
592 case EXTRN: case EXTRN1: case STATIC:
593 return pexpr(cadr(e));
594 #if 0
592 case REGISTER: 595 case REGISTER:
593 switch(n->ty) { 596 switch(n->ty) {
594 case ULONGLONG: case LONGLONG: 597 case ULONGLONG: case LONGLONG:
595 v = get_lregister_var(n); break; 598 v = get_lregister_var(n); break;
596 case FLOAT: 599 case FLOAT:
601 if (scalar(n->ty)) 604 if (scalar(n->ty))
602 v = get_register_var(n); 605 v = get_register_var(n);
603 else 606 else
604 error(TYERR); 607 error(TYERR);
605 } 608 }
606 case EXTRN: case EXTRN1: case STATIC: 609 #endif
607 return pexpr(cadr(e));
608 default: 610 default:
609 v = list3(LVAR,new_lvar(size(n->ty)),(int)n); 611 v = list3(LVAR,new_lvar(size(n->ty)),(int)n);
610 } 612 }
611 inline_lvars = glist2(v,inline_lvars); 613 inline_lvars = glist2(v,inline_lvars);
612 if (heap[pdisp+dsp]) error(-1); 614 if (heap[pdisp+dsp]) error(-1);
928 case LMOD: case LUMOD: 930 case LMOD: case LUMOD:
929 case LLSHIFT: case LULSHIFT: case LRSHIFT: case LURSHIFT: 931 case LLSHIFT: case LULSHIFT: case LRSHIFT: case LURSHIFT:
930 case LADD: case LSUB: case LBAND: case LEOR: case LBOR: case LCMP: 932 case LADD: case LSUB: case LBAND: case LEOR: case LBOR: case LCMP:
931 #endif 933 #endif
932 return pbinop(car(e1),e2,caddr(e1)); 934 return pbinop(car(e1),e2,caddr(e1));
933 case LCOND: case DCOND: case FCOND: case COND: 935 case LCOND: case DCOND: case FCOND: case COND: case UCOND: case LUCOND:
934 e3 = pexpr(e2); 936 e3 = pexpr(e2);
935 if (car(e3)==CONST) return pexpr(cadr(e3)?caddr(e1):cadddr(e1)); 937 if (car(e3)==CONST) return pexpr(cadr(e3)?caddr(e1):cadddr(e1));
936 return list4(car(e1),e3,pexpr(cadr(e1)),pexpr(cadr(e2))); 938 return list4(car(e1),e3,pexpr(cadr(e1)),pexpr(cadr(e2)));
937 case STASS: 939 case STASS:
938 return psassign(e1); 940 return psassign(e1);
1029 int scslabel = cslabel; 1031 int scslabel = cslabel;
1030 int sdisp = pdisp; 1032 int sdisp = pdisp;
1031 int sret_register = ret_register; 1033 int sret_register = ret_register;
1032 int sret_reg_mode = ret_reg_mode; 1034 int sret_reg_mode = ret_reg_mode;
1033 int sinline_lvars = inline_lvars; 1035 int sinline_lvars = inline_lvars;
1036 int slfree=lfree;
1034 1037
1035 int narg,arg; 1038 int narg,arg;
1036 NMTBL *n = (NMTBL*)cadr(cadr(e)); 1039 NMTBL *n = (NMTBL*)cadr(cadr(e));
1037 int e1 = attr_value(n,INLINE); 1040 int e1 = attr_value(n,INLINE);
1038 int parse = car(e1); // inline parse tree 1041 int parse = car(e1); // inline parse tree
1117 retcont = sretcont; 1120 retcont = sretcont;
1118 cslabel = scslabel; 1121 cslabel = scslabel;
1119 ret_register = sret_register; 1122 ret_register = sret_register;
1120 ret_reg_mode = sret_reg_mode; 1123 ret_reg_mode = sret_reg_mode;
1121 inline_lvars = sinline_lvars; 1124 inline_lvars = sinline_lvars;
1125 lfree=slfree;
1122 1126
1123 return ret_type; 1127 return ret_type;
1124 } 1128 }
1125 1129
1126 /* end */ 1130 /* end */