462
|
1 /* Micro-C Partial Evaluator Part */
|
|
2 /* $Id$ */
|
|
3
|
|
4 #include <stdio.h>
|
|
5 #include "mc.h"
|
|
6 #include "mc-parse.h"
|
|
7 #include "mc-codegen.h"
|
|
8 #include "mc-switch.h"
|
464
|
9 #include "mc-code.h"
|
|
10 #include "mc-inline.h"
|
462
|
11
|
463
|
12 static int pvartable;
|
|
13 static int pdisp;
|
462
|
14
|
514
|
15 static int ret_register,ret_reg_mode;
|
|
16
|
527
|
17 static int inline_lvars;
|
|
18
|
462
|
19 /*
|
|
20 Basic code generator from parse tree
|
|
21 */
|
|
22
|
|
23 extern void
|
|
24 st_decl(int e1){
|
|
25 // NMTBL *n = (NMTBL *)caddr(e1);
|
|
26 // int stmode = cadddr(e1);
|
|
27 }
|
|
28
|
|
29 extern void
|
|
30 st_if(int e1){
|
|
31 int l1,l2,slfree;
|
|
32 int e2=caddr(e1),e3;
|
|
33 // conv->if_();
|
|
34 slfree=lfree;
|
|
35 checkret();
|
|
36 l1 = bexpr(car(e2),0,fwdlabel());
|
|
37 // conv->if_then_();
|
|
38 g_expr_u(cadr(e2));
|
|
39 checkret();
|
|
40 if ((e3=caddr(e2))) { // else
|
|
41 // conv->if_else_();
|
|
42 if ((l2 = control))
|
|
43 gen_jmp(l2=fwdlabel());
|
|
44 fwddef(l1);
|
|
45 g_expr_u(e3);
|
|
46 checkret();
|
|
47 if (l2) fwddef(l2);
|
|
48 } else {
|
|
49 fwddef(l1);
|
|
50 }
|
|
51 // conv->if_endif_();
|
|
52 }
|
|
53
|
|
54
|
|
55 extern void
|
|
56 st_do(int e1){
|
|
57 int sbreak,scontinue,l;
|
|
58
|
|
59 sbreak=blabel;
|
|
60 scontinue=clabel;
|
|
61 blabel=fwdlabel();
|
|
62 clabel=fwdlabel();
|
|
63 control=1;
|
|
64 checkret();
|
|
65 l=backdef();
|
|
66 // conv->dowhile_();
|
|
67 g_expr_u(cadddr(e1));
|
|
68 checkret();
|
|
69 // conv->dowhile_cond_();
|
|
70 bexpr(caddr(e1),1,l);
|
|
71 // conv->dowhile_end_();
|
|
72 fwddef(blabel);
|
|
73 clabel=scontinue;
|
|
74 blabel=sbreak;
|
|
75 }
|
|
76
|
|
77
|
|
78 extern void
|
|
79 st_while(int e1){
|
|
80 int sbreak,scontinue,e;
|
|
81
|
|
82 sbreak=blabel;
|
|
83 scontinue=clabel;
|
|
84 blabel=fwdlabel();
|
|
85 control=1;
|
|
86 checkret();
|
|
87 clabel=backdef();
|
|
88 // conv->while_();
|
|
89 // conv->while_body_();
|
|
90 if(!(e=cadddr(e1))) {
|
|
91 bexpr(caddr(e1),1,clabel);
|
|
92 // conv->sm_();
|
|
93 } else {
|
|
94 bexpr(caddr(e1),0,blabel);
|
|
95 g_expr_u(e);
|
|
96 checkret();
|
|
97 if(control)
|
|
98 gen_jmp(clabel);
|
|
99 }
|
|
100 // conv->while_end_();
|
|
101 fwddef(blabel);
|
|
102 clabel=scontinue;
|
|
103 blabel=sbreak;
|
|
104 }
|
|
105
|
|
106
|
|
107 extern void
|
|
108 st_for(int e1){
|
|
109 int p0,p1,p2,body;
|
|
110 int l,e;
|
|
111 int sbreak=blabel;
|
|
112 int scontinue=clabel;
|
|
113
|
|
114 e = caddr(e1);
|
|
115 p0 = car(e); p1 = cadr(e); p2 = caddr(e); body = cadddr(e);
|
|
116
|
|
117 blabel=fwdlabel();
|
|
118 // conv->for_();
|
|
119 if (p0) {
|
|
120 checkret();
|
|
121 g_expr_u(p0);
|
|
122 }
|
|
123 // conv->for1_();
|
|
124 control=1;
|
|
125 checkret();
|
|
126 l=backdef();
|
|
127 if (p1) {
|
|
128 bexpr(p1,0,blabel);
|
|
129 }
|
|
130 // conv->for2_();
|
|
131 // conv->for_body_();
|
|
132 if (!p2) {
|
|
133 clabel=l;
|
|
134 g_expr_u(body);
|
|
135 checkret();
|
|
136 } else {
|
|
137 clabel=fwdlabel();
|
|
138 g_expr_u(body);
|
|
139 checkret();
|
|
140 fwddef(clabel);
|
|
141 g_expr_u(p2);
|
|
142 }
|
|
143 // conv->for_end_();
|
|
144 gen_jmp(l);
|
|
145 fwddef(blabel);
|
|
146 clabel=scontinue;
|
|
147 blabel=sbreak;
|
|
148 }
|
|
149
|
|
150
|
|
151 extern void
|
|
152 st_switch(int e1){
|
|
153 int sbreak,scase,sdefault,slfree,svalue,slist;
|
|
154
|
|
155 checkret();
|
|
156 slist = cslist;
|
|
157 cslist = 0;
|
|
158 sbreak=blabel; /* save parents break label */
|
|
159 blabel=fwdlabel();
|
|
160 sdefault=dlabel; /* save parents default label */
|
|
161 dlabel=0;
|
|
162 scase=cslabel; /* save parents next case label */
|
|
163 // conv->switch_();
|
|
164 slfree=lfree;
|
|
165 svalue=csvalue1; /* save parents switch value */
|
506
|
166 gexpr(caddr(e1),1); /* switch value */
|
462
|
167 csvalue1=csvalue() ;
|
|
168 // conv->switch_body_();
|
|
169 cslabel = control = 0;
|
|
170 g_expr_u(cadddr(e1));
|
|
171 // conv->switch_end_();
|
|
172 checkret();
|
|
173 #if CASE_CODE
|
|
174 if (control) gen_jmp(blabel);
|
|
175 genswitch(cslist,cslabel);
|
|
176 #else
|
|
177 if(dlabel) def_label(cslabel,dlabel);
|
|
178 else fwddef(cslabel);
|
|
179 #endif
|
|
180 csvalue1=svalue;
|
|
181 cslabel=scase;
|
|
182 dlabel=sdefault;
|
|
183 fwddef(blabel);
|
|
184 blabel=sbreak;
|
|
185 cslist = slist;
|
|
186 }
|
|
187
|
|
188
|
|
189 extern void
|
|
190 st_comp(int e1){
|
|
191 g_expr_u(caddr(e1));
|
|
192 }
|
|
193
|
|
194
|
|
195 extern void
|
|
196 st_break(int e1){
|
|
197 checkret();
|
|
198 // conv->break_();
|
|
199 if (control)
|
|
200 gen_jmp(blabel);
|
|
201 }
|
|
202
|
|
203
|
|
204 extern void
|
|
205 st_continue(int e1){
|
|
206 checkret();
|
|
207 // conv->continue_();
|
|
208 if (control) gen_jmp(clabel);
|
|
209 }
|
|
210
|
|
211
|
|
212 extern void
|
|
213 st_case(int e1){
|
|
214 #if CASE_CODE
|
|
215 int l,clist=caddr(e1),c;
|
|
216 l = fwdlabel();
|
|
217 // conv->case_begin_(0,0);
|
|
218 // conv->case_(0,0);
|
|
219 if (retpending) {
|
|
220 ret(); retpending=0;
|
|
221 }
|
|
222 if (!cslabel) {
|
|
223 if (!control) {
|
|
224 cmpdimm(car(clist),csvalue1,cslabel=fwdlabel(),1);
|
|
225 caddr(clist)=0;
|
|
226 } else {
|
|
227 error(-1);
|
|
228 }
|
|
229 }
|
|
230 while(clist) {
|
|
231 caddr(clist) = l;
|
|
232 clist = cadr(c=clist); cadr(c) = 0; // insert destroy cadr of clist
|
|
233 cslist=insert_ascend(cslist,c,docase_eq);
|
|
234 }
|
|
235 fwddef(l);
|
|
236 control=1;
|
|
237 #else
|
|
238 /* casading branch implementation */
|
|
239 int c,l;
|
|
240 c = caddr(e1);
|
|
241 if (retpending) {
|
|
242 ret(); retpending=0;
|
|
243 }
|
|
244 // conv->case_begin_(0,0);
|
|
245 // conv->case_(0,0);
|
|
246 l=fwdlabel();
|
|
247 if (control) {
|
|
248 control=0;
|
|
249 gen_jmp(l);
|
|
250 }
|
|
251 if (cslabel) fwddef(cslabel);
|
|
252 while(cadr(c)) {
|
|
253 cmpdimm(car(c),csvalue1,l,0);
|
|
254 c=cadr(c);
|
|
255 }
|
|
256 cmpdimm(car(c),csvalue1,cslabel=fwdlabel(),1);
|
|
257 if (l) fwddef(l);
|
|
258 #endif
|
|
259 }
|
|
260
|
|
261
|
|
262 extern void
|
|
263 st_default(int e1){
|
|
264 control=1;
|
|
265 checkret();
|
|
266 if (dlabel) error(STERR); // double default:
|
|
267 dlabel = backdef();
|
|
268 // conv->case_(0,1);
|
|
269 }
|
|
270
|
|
271
|
|
272 extern void
|
|
273 st_return(int e1){
|
514
|
274 int e,t;
|
462
|
275
|
|
276 if (!cslabel) gen_jmp(cslabel = fwdlabel());
|
|
277 if(!(e=caddr(e1))) {
|
513
|
278 // no return value
|
462
|
279 retpending = 1;
|
|
280 return;
|
|
281 }
|
551
|
282 t = type_value(cadr(fnptr->ty));
|
|
283 if (t>0 && (car(t)==STRUCT || car(t)==UNION)) {
|
|
284 // copy is included in e, pass the pointer
|
|
285 t = list2(POINTER,type_value(cadr(fnptr->ty)));
|
|
286 }
|
|
287 g_expr(e);
|
|
288 if (ret_reg_mode==0) {
|
|
289 // return value register is not fixed
|
|
290 ret_reg_mode=1;
|
|
291 ret_register = code_get_fixed_creg(USE_CREG,t);
|
462
|
292 } else {
|
551
|
293 code_set_fixed_creg(ret_register,1,t);
|
462
|
294 }
|
|
295 // conv->return_end_();
|
|
296 retpending = 1;
|
|
297 }
|
|
298
|
|
299 extern void
|
|
300 st_goto(int e){
|
551
|
301 NMTBL *nptr0;
|
|
302 int e1,e2,env;
|
462
|
303
|
|
304 checkret();
|
|
305 e1 = caddr(e);
|
|
306 if (car(e1)==RINDIRECT) {
|
|
307 gen_indirect_goto(cadr(e1));
|
505
|
308 return ;
|
552
|
309 } else if (car(e1)==RLVAR) {
|
551
|
310 gen_indirect_goto(e1);
|
|
311 return ;
|
552
|
312 } else if (car(e1)==LVAR||car(e1)==FLABEL) {
|
551
|
313 gen_jmp(cadr(e1));
|
462
|
314 control=0;
|
505
|
315 return ;
|
551
|
316 } else if (car(e1)==CODE) {
|
462
|
317 /* CbC continuation */
|
|
318 // conv->jump_(env);
|
551
|
319 // should be separate function
|
462
|
320 e2 = cadr(e1);
|
|
321 env = caddr(e1);
|
|
322 if (car(e2) == FNAME) {
|
|
323 nptr0=(NMTBL *)cadr(e2);
|
|
324 if (nptr0->sc==EMPTY)
|
|
325 nptr0->sc = EXTRN1;
|
|
326 else if(nptr0->sc==FUNCTION)
|
|
327 nptr0->sc = CODE;
|
|
328 if (nptr0->ty>0&&car(nptr0->ty)==FUNCTION)
|
|
329 car(nptr0->ty)=CODE;
|
|
330 }
|
|
331 gexpr(list3(CODE,e1,env),0);
|
|
332 control=0;
|
|
333 // conv->sm_();
|
505
|
334 return ;
|
551
|
335 } else {
|
|
336 error(-1);
|
462
|
337 }
|
|
338 }
|
|
339
|
|
340
|
|
341 #if ASM_CODE
|
|
342 extern void
|
|
343 st_asm(int e1){
|
|
344 checkret();
|
|
345 g_expr_u(list3(ASM,caddr(e1),cadddr(e1)));
|
|
346 }
|
|
347 #endif
|
|
348
|
|
349
|
|
350 extern void
|
|
351 st_label(int e1){
|
551
|
352 int lb = caddr(e1);
|
462
|
353 control=1;
|
|
354 checkret();
|
551
|
355 if (car(lb)==LVAR) { // label variable case
|
|
356 } else if (car(lb)!=FLABEL) error(-1);
|
|
357 fwddef(cadr(lb));
|
462
|
358 }
|
|
359
|
|
360 extern void
|
|
361 st_comment(int e1){
|
|
362 gen_comment((char *)caddr(e1));
|
|
363 }
|
|
364
|
|
365 /*
|
|
366 partial evaluator
|
|
367 */
|
|
368
|
|
369 static int
|
463
|
370 p_vartable(int e,int adisp,int ldisp)
|
462
|
371 {
|
464
|
372 int i;
|
505
|
373 int pvartable = getfree(adisp-ldisp); // have to be local heap
|
509
|
374 pdisp = pvartable-ldisp;
|
|
375 for(i=ldisp;i<0;i++) {
|
|
376 heap[pdisp+i] = 0;
|
463
|
377 }
|
505
|
378 return pvartable;
|
462
|
379 }
|
|
380
|
|
381 static int
|
|
382 p_lvar(int e1)
|
|
383 {
|
463
|
384 int sz = is_memory(e1);
|
|
385 int d = cadr(e1);
|
527
|
386 int d1,e;
|
502
|
387 if ((d1=(heap[pdisp+d]))) return d1;
|
527
|
388 e = heap[pdisp+d]=list3(LVAR,new_lvar(sz),0);
|
|
389 inline_lvars = glist2(e,inline_lvars);
|
|
390 return e;
|
462
|
391 }
|
|
392
|
|
393 static int
|
|
394 pfunction(int e)
|
|
395 {
|
501
|
396 // list4(INLINE,e1,arglist,ftype);
|
|
397 // include code segement case
|
|
398 int e1 = pexpr(cadr(e));
|
|
399 int arglist = caddr(e);
|
|
400 int newargs = 0;
|
|
401 int ftype = cadddr(e);
|
|
402 int e3;
|
|
403 for (e3 = arglist; e3; e3 = cadr(e3)) {
|
514
|
404 newargs = list3( pexpr(car(e3)), newargs, caddr(e3));
|
501
|
405 }
|
|
406 newargs = reverse0(newargs);
|
513
|
407 return list4(car(e),e1,newargs,ftype);
|
462
|
408 }
|
|
409
|
|
410 static int
|
|
411 prindirect(int e)
|
|
412 {
|
525
|
413 int lvar;
|
533
|
414 int offset = caddr(e);
|
530
|
415 if (car(lvar=cadr(e))==IVAR) {
|
525
|
416 lvar=p_lvar(cadr(e)); // can be anything....
|
530
|
417 switch(car(lvar)) {
|
|
418 case LVAR:
|
533
|
419 if(offset) {
|
|
420 return list3(car(e),lvar,offset);
|
|
421 }
|
530
|
422 return rvalue_t(lvar,cadddr(e));
|
|
423 case REGISTER: case DREGISTER:
|
|
424 case FREGISTER: case LREGISTER:
|
|
425 case CONST: case FCONST: case DCONST: case LCONST:
|
|
426 // should do type check
|
533
|
427 if (offset) error(-1);
|
530
|
428 return lvar;
|
|
429 }
|
512
|
430 }
|
533
|
431 return list3(car(e),pexpr(cadr(e)),offset);
|
462
|
432 }
|
|
433
|
|
434 static int
|
527
|
435 pindirect(int e)
|
|
436 {
|
|
437 int lvar;
|
|
438 if (car(lvar=cadr(e))==IVAR)
|
|
439 lvar=p_lvar(cadr(e)); // can be anything....
|
|
440 return list3(car(e),pexpr(cadr(e)),caddr(e));
|
|
441 }
|
|
442
|
|
443 static int
|
462
|
444 paddress(int e)
|
|
445 {
|
501
|
446 return list2(car(e),pexpr(cadr(e)));
|
462
|
447 }
|
|
448
|
|
449 static int
|
464
|
450 p_conv(int e1,int e2)
|
462
|
451 {
|
527
|
452 return list3(CONV,pexpr(e2),e1);
|
462
|
453 }
|
|
454
|
|
455 static int
|
464
|
456 pbinop(int op,int e1,int e2)
|
462
|
457 {
|
533
|
458 // we should call binop here, but we don't know the type...
|
501
|
459 return list3(op,pexpr(e1),pexpr(e2));
|
462
|
460 }
|
|
461
|
|
462 static int
|
502
|
463 prexpr(int op,int e1,int e2)
|
|
464 {
|
|
465 return list3(op,pexpr(e1),pexpr(e2));
|
|
466 }
|
|
467
|
|
468 static int
|
526
|
469 plor(int op,int e1,int e2)
|
|
470 {
|
|
471 return list3(op,pexpr(e1),pexpr(e2));
|
|
472 }
|
|
473
|
|
474 static int
|
|
475 pland(int op,int e1,int e2)
|
|
476 {
|
|
477 return list3(op,pexpr(e1),pexpr(e2));
|
|
478 }
|
|
479
|
|
480 static int
|
462
|
481 psassign(int e)
|
|
482 {
|
501
|
483 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
484 }
|
|
485
|
|
486 static int
|
|
487 passign(int e)
|
|
488 {
|
501
|
489 return list3(car(e),pexpr(cadr(e)),pexpr(caddr(e)));
|
462
|
490 }
|
|
491
|
|
492 static int
|
|
493 passop(int e)
|
|
494 {
|
501
|
495 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
496 }
|
|
497
|
|
498 static int
|
|
499 pdassign(int e)
|
|
500 {
|
501
|
501 return list3(car(e),pexpr(cadr(e)),pexpr(caddr(e)));
|
462
|
502 }
|
|
503
|
|
504 static int
|
|
505 pdassop(int e)
|
|
506 {
|
501
|
507 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
508 }
|
|
509
|
|
510 static int
|
|
511 plassign(int e)
|
|
512 {
|
501
|
513 return list3(car(e),pexpr(cadr(e)),pexpr(caddr(e)));
|
462
|
514 }
|
|
515
|
|
516 static int
|
|
517 plassop(int e)
|
|
518 {
|
501
|
519 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
520 }
|
|
521
|
|
522 static int
|
|
523 palloc(int e)
|
|
524 {
|
501
|
525 return list2(car(e),pexpr(cadr(e)));
|
462
|
526 }
|
|
527
|
|
528 static int
|
464
|
529 pcomma(int e1,int e2)
|
462
|
530 {
|
501
|
531 return list3(COMMA,pexpr(e1),pexpr(e2));
|
462
|
532 }
|
|
533
|
|
534 static int
|
|
535 prbit_field(int e)
|
|
536 {
|
501
|
537 return list3(car(e),pexpr(cadr(e)),caddr(e));
|
462
|
538 }
|
|
539
|
|
540 static int
|
|
541 pbassign(int e)
|
|
542 {
|
501
|
543 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
544 }
|
|
545
|
|
546 static int
|
|
547 pbassop(int e)
|
|
548 {
|
501
|
549 return list4(car(e),pexpr(cadr(e)),pexpr(caddr(e)),cadddr(e));
|
462
|
550 }
|
|
551
|
|
552 static int
|
|
553 p_decl(int e)
|
|
554 {
|
552
|
555 // list4(ST_DECL,parse,(int)n,list3(mode,stmode,ctmode));
|
|
556 int ctmode=cadddr(e);;
|
463
|
557 NMTBL *n=(NMTBL*)caddr(e);
|
|
558 int dsp = n->dsp;
|
|
559 int v;
|
552
|
560 int sstmode = stmode;
|
|
561 int smode = mode;
|
500
|
562 // in real partial evaluation, we have to check whether this variable
|
|
563 // is used or not.
|
552
|
564 if (ctmode) {
|
|
565 mode = car(ctmode); stmode = cadr(ctmode); ctmode = caddr(ctmode);
|
|
566 }
|
463
|
567 switch(stmode) {
|
528
|
568 case EXTRN: case EXTRN1: case STATIC:
|
552
|
569 // def(n,ctmode); we don't need this. already done.
|
|
570 // stmode = sstmode;
|
|
571 stmode = sstmode;
|
|
572 mode = smode;
|
|
573 return pexpr(cadr(e));
|
|
574 // case LLDECL: LLDECL is mode, not stmode (bad design)
|
|
575 // v = list2(FLABEL,fwdlabel()); break;
|
529
|
576 #if 1
|
463
|
577 case REGISTER:
|
|
578 switch(n->ty) {
|
|
579 case ULONGLONG: case LONGLONG:
|
|
580 v = get_lregister_var(n); break;
|
|
581 case FLOAT:
|
|
582 v = get_dregister_var(n,0); break;
|
|
583 case DOUBLE:
|
|
584 v = get_dregister_var(n,1); break;
|
|
585 default:
|
|
586 if (scalar(n->ty))
|
524
|
587 v = get_register_var(n);
|
463
|
588 else
|
|
589 error(TYERR);
|
|
590 }
|
529
|
591 break;
|
528
|
592 #endif
|
463
|
593 default:
|
552
|
594 if (n->sc==FLABEL)
|
|
595 v = list3(LVAR,fwdlabel(),(int)n);
|
|
596 else
|
|
597 v = list3(LVAR,new_lvar(size(n->ty)),(int)n);
|
463
|
598 }
|
552
|
599 if (n->sc!=FLABEL)
|
|
600 inline_lvars = glist2(v,inline_lvars);
|
463
|
601 if (heap[pdisp+dsp]) error(-1);
|
|
602 heap[pdisp+dsp]=v;
|
552
|
603 stmode = sstmode;
|
|
604 mode = smode;
|
463
|
605 return pexpr(cadr(e));
|
462
|
606 }
|
|
607
|
|
608 static int
|
500
|
609 p_if(int e1)
|
462
|
610 {
|
500
|
611 int cond,l1,l2;
|
|
612 int e2=caddr(e1),e3;
|
|
613 cond = pexpr(car(e2));
|
|
614 // conv->if_then_();
|
|
615 l1 = pexpr(cadr(e2));
|
|
616 if ((e3=caddr(e2))) { // else
|
|
617 l2 = pexpr(e3);
|
|
618 } else {
|
|
619 l2 = 0;
|
|
620 }
|
|
621 return list3(ST_IF,pexpr(cadr(e1)),list3(cond,l1,l2));
|
462
|
622 }
|
|
623
|
|
624 static int
|
|
625 p_do(int e)
|
|
626 {
|
524
|
627 int e2 = pexpr(caddr(e));
|
|
628 int e3 = pexpr(cadddr(e));
|
|
629 return list4(ST_DO,pexpr(cadr(e)),e2,e3);
|
462
|
630 }
|
|
631
|
|
632 static int
|
|
633 p_while(int e)
|
|
634 {
|
524
|
635 int e2 = pexpr(caddr(e));
|
|
636 int e3 = pexpr(cadddr(e));
|
|
637 return list4(ST_WHILE,pexpr(cadr(e)),e2,e3);
|
462
|
638 }
|
|
639
|
|
640 static int
|
|
641 p_for(int e)
|
|
642 {
|
501
|
643 int e1=caddr(e);
|
524
|
644 int p0=pexpr(car(e1));
|
|
645 int p1=pexpr(cadr(e1));
|
|
646 int p2=pexpr(caddr(e1));
|
|
647 int p3=pexpr(cadddr(e1));
|
|
648 return list3(ST_FOR,pexpr(cadr(e)), list4(p0,p1,p2,p3));
|
462
|
649 }
|
|
650
|
|
651 static int
|
|
652 p_switch(int e)
|
|
653 {
|
524
|
654 int e2 = pexpr(caddr(e));
|
|
655 int e3 = pexpr(cadddr(e));
|
|
656 return list4(ST_SWITCH,pexpr(cadr(e)),e2,e3);
|
462
|
657 }
|
|
658
|
|
659 static int
|
|
660 p_comp(int e)
|
|
661 {
|
524
|
662 int e1=pexpr(caddr(e));
|
|
663 return list3(ST_COMP,pexpr(cadr(e)),e1);
|
462
|
664 }
|
|
665
|
|
666 static int
|
|
667 p_break(int e)
|
|
668 {
|
502
|
669 return list2(ST_BREAK,pexpr(cadr(e)));
|
462
|
670 }
|
|
671
|
|
672 static int
|
|
673 p_continue(int e)
|
|
674 {
|
502
|
675 return list2(ST_CONTINUE,pexpr(cadr(e)));
|
462
|
676 }
|
|
677
|
|
678 static int
|
|
679 p_case(int e)
|
|
680 {
|
506
|
681 int new=0,clist = caddr(e);
|
|
682 // insert destory clist, we have to copy it now
|
|
683 for(;clist;clist=cadr(clist))
|
|
684 new=glist3(car(clist),new,0);
|
|
685 return list3(ST_CASE,pexpr(cadr(e)),reverse0(new));
|
462
|
686 }
|
|
687
|
|
688 static int
|
|
689 p_default(int e)
|
|
690 {
|
502
|
691 return list2(ST_DEFAULT,pexpr(cadr(e)));
|
462
|
692 }
|
|
693
|
|
694 static int
|
|
695 p_return(int e)
|
|
696 {
|
524
|
697 int e1=pexpr(caddr(e));
|
|
698 return list3(ST_RETURN,pexpr(cadr(e)),e1);
|
462
|
699 }
|
|
700
|
|
701 static int
|
|
702 p_goto(int e)
|
|
703 {
|
551
|
704 int e1,lb;
|
501
|
705 if ((e1=caddr(e))) {
|
|
706 switch(car(e1)) {
|
|
707 case RINDIRECT: e1=pexpr(e1); break;
|
|
708 case CODE: e1=list3(CODE,pexpr(cadr(e1)),pexpr(caddr(e1))); break;
|
551
|
709 case FLABEL: /* error(-1); */ break;
|
|
710 case IVAR:
|
|
711 lb = cadr(e1);
|
|
712 if (!(e1=heap[pdisp+lb])) {
|
|
713 e1 = heap[pdisp+lb]=list2(FLABEL,fwdlabel());
|
|
714 }
|
501
|
715 }
|
|
716 }
|
502
|
717 return list3(ST_GOTO,pexpr(cadr(e)),e1);
|
501
|
718 }
|
|
719
|
|
720 static int
|
|
721 p_list_expr(int e)
|
|
722 {
|
|
723 int e3,new = 0;
|
|
724 for (e3 = e; e3; e3 = cadr(e3)) {
|
|
725 new= list2( pexpr(car(e3)), new);
|
|
726 }
|
|
727 return reverse0(new);
|
462
|
728 }
|
|
729
|
|
730 static int
|
|
731 p_asm(int e)
|
|
732 {
|
501
|
733 int param=caddr(e);
|
|
734 int e1 = p_list_expr(cadddr(e));
|
|
735 return list4(ST_ASM,pexpr(cadr(e)),param,e1);
|
462
|
736 }
|
|
737
|
|
738 static int
|
|
739 p_label(int e)
|
|
740 {
|
551
|
741 int e1,lb;
|
|
742 if ((e1=caddr(e))) {
|
|
743 switch(car(e1)) {
|
|
744 case FLABEL: /* error(-1); */ break;
|
|
745 case IVAR:
|
|
746 lb = cadr(e1);
|
|
747 if (!(e1=heap[pdisp+lb])) {
|
|
748 e1 = heap[pdisp+lb]=list2(FLABEL,fwdlabel());
|
|
749 }
|
|
750 }
|
|
751 }
|
|
752 return list3(ST_LABEL,pexpr(cadr(e)),e1);
|
|
753 }
|
|
754
|
|
755 static int
|
|
756 p_label_var(int e)
|
|
757 {
|
|
758 int d,e1;
|
|
759 switch(car(e1=e)) {
|
|
760 case LVAR: /* error(-1) */ break;
|
|
761 case IVAR:
|
|
762 // should this done in p_decl? (in __label__?)
|
|
763 d = cadr(e);
|
|
764 if (!(e1=(heap[pdisp+d]))) {
|
552
|
765 // error(-1);
|
551
|
766 e1 = heap[pdisp+d]=list3(LVAR,fwdlabel(),caddr(e));
|
|
767 }
|
|
768 }
|
|
769 return list2(LABEL,e1);
|
462
|
770 }
|
|
771
|
|
772 static int
|
|
773 p_bool(int e)
|
|
774 {
|
501
|
775 error(-1);
|
464
|
776 return e;
|
|
777 }
|
462
|
778
|
464
|
779 static int
|
|
780 p_comment(int e)
|
|
781 {
|
501
|
782 return list3(ST_COMMENT,pexpr(cadr(e)),caddr(e));
|
462
|
783 }
|
|
784
|
508
|
785 static int
|
512
|
786 p_inline(int e)
|
508
|
787 {
|
|
788 int e3;
|
|
789 int narg;
|
|
790
|
|
791 /* inline function arguments */
|
|
792 narg = 0;
|
|
793 for (e3 = caddr(e); e3; e3 = cadr(e3)) {
|
|
794 narg=list3(pexpr(car(e3)),narg,caddr(e3));
|
|
795 }
|
|
796 return list4(INLINE,cadr(e),reverse0(narg),cadddr(e));
|
|
797 }
|
|
798
|
463
|
799 extern int
|
|
800 pexpr(int e1)
|
462
|
801 {
|
|
802 int e2,e3;
|
|
803
|
463
|
804 // if (inmode) error(-1);
|
502
|
805 if (e1==0) return 0;
|
462
|
806 e2 = cadr(e1);
|
|
807 switch (car(e1)){
|
|
808 case GVAR: case RGVAR: case CRGVAR: case CURGVAR: case SRGVAR:
|
|
809 case SURGVAR: case REGISTER:
|
|
810 case DREGISTER: case FREGISTER:
|
500
|
811 case FRGVAR: case DRGVAR:
|
462
|
812 case LREGISTER:
|
500
|
813 case LRGVAR: case LURGVAR:
|
551
|
814 case CONST:
|
462
|
815 case DCONST: case FCONST:
|
|
816 case LCONST:
|
|
817 case STRING:
|
|
818 case FNAME:
|
503
|
819 case FLABEL:
|
462
|
820 return e1;
|
551
|
821 case RSTRUCT:
|
|
822 // list3(RSTRUCT,e,size)
|
|
823 return pexpr(e2);
|
|
824 case LABEL:
|
|
825 return p_label_var(e2);
|
462
|
826 case LVAR:
|
|
827 case RLVAR: case CRLVAR: case CURLVAR: case SRLVAR: case SURLVAR:
|
500
|
828 case FRLVAR: case DRLVAR:
|
|
829 case LRLVAR: case LURLVAR:
|
|
830 return e1;
|
|
831 case IVAR:
|
462
|
832 return p_lvar(e1);
|
|
833 case FUNCTION:
|
|
834 return pfunction(e1);
|
|
835 case CODE:
|
463
|
836 return list2(car(e1),pexpr(e2));
|
462
|
837 case INLINE:
|
512
|
838 return p_inline(e1);
|
462
|
839 case INDIRECT:
|
527
|
840 return pindirect(e1);
|
462
|
841 case RINDIRECT: case URINDIRECT:
|
|
842 case CRINDIRECT: case CURINDIRECT:
|
|
843 case SRINDIRECT: case SURINDIRECT:
|
|
844 case FRINDIRECT: case DRINDIRECT:
|
|
845 case LRINDIRECT: case LURINDIRECT:
|
|
846 return prindirect(e1);
|
|
847 case ADDRESS:
|
502
|
848 return paddress(e1);
|
462
|
849 case MINUS:
|
463
|
850 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
851 if (car(e3)==CONST) return list2(CONST,-cadr(e3));
|
|
852 return list2(car(e1),e3);
|
|
853 #if LONGLONG_CODE
|
|
854 case LMINUS:
|
463
|
855 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
856 if (car(e3)==LCONST) return llist2(LCONST,-lcadr(e3));
|
|
857 return list2(car(e1),e3);
|
|
858 #endif
|
|
859 #if FLOAT_CODE
|
|
860 case DMINUS:
|
463
|
861 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
862 if (car(e3)==DCONST) return dlist2(DCONST,-dcadr(e3));
|
|
863 if (car(e3)==FCONST) return dlist2(FCONST,-dcadr(e3));
|
|
864 return list2(car(e1),e3);
|
|
865 case FMINUS:
|
463
|
866 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
867 if (car(e3)==DCONST) return dlist2(DCONST,-dcadr(e3));
|
|
868 if (car(e3)==FCONST) return dlist2(FCONST,-dcadr(e3));
|
|
869 return list2(car(e1),e3);
|
|
870 #endif
|
|
871 case CONV:
|
501
|
872 return p_conv(caddr(e1),e2);
|
462
|
873 case BNOT: /* ~ */
|
463
|
874 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
875 if (car(e3)==CONST) return list2(CONST,~cadr(e3));
|
|
876 return list2(BNOT,e3);
|
|
877 case LNOT: /* ! */
|
463
|
878 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
879 if (car(e3)==CONST) return list2(CONST,!cadr(e3));
|
|
880 return list2(LNOT,e3);
|
|
881 case PREINC:
|
|
882 case UPREINC:
|
463
|
883 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
884 if (car(e3)==CONST) return list2(CONST,cadr(e3)+1);
|
503
|
885 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
886 case POSTINC:
|
|
887 case UPOSTINC:
|
463
|
888 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
889 if (car(e3)==CONST) return e3;
|
503
|
890 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
891 #if FLOAT_CODE
|
|
892 case DPREINC: /* ++d */
|
463
|
893 if ((e3 = pexpr(e2))==e2) return e1;
|
|
894 if (car(e3)==FCONST) return dlist2(FCONST,dcadr(e3)+cadr(e2));
|
|
895 if (car(e3)==DCONST) return dlist2(DCONST,dcadr(e3)+cadr(e2));
|
503
|
896 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
897 case DPOSTINC: /* d++ */
|
463
|
898 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
899 if (car(e3)==FCONST||car(e3)==DCONST) return e3;
|
503
|
900 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
901 case FPREINC: /* ++f */
|
463
|
902 if ((e3 = pexpr(e2))==e2) return e1;
|
|
903 if (car(e3)==FCONST) return dlist2(FCONST,dcadr(e3)+cadr(e2));
|
|
904 if (car(e3)==DCONST) return dlist2(DCONST,dcadr(e3)+cadr(e2));
|
503
|
905 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
906 case FPOSTINC: /* f++ */
|
463
|
907 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
908 if (car(e3)==FCONST||car(e3)==DCONST) return e3;
|
503
|
909 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
910 #endif
|
|
911 #if LONGLONG_CODE
|
|
912 case LPREINC: /* ++d */
|
|
913 case LUPREINC: /* ++d */
|
463
|
914 if ((e3 = pexpr(e2))==e2) return e1;
|
|
915 if (car(e3)==LCONST) return llist2(LCONST,lcadr(e3)+cadr(e2));
|
503
|
916 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
917 case LPOSTINC: /* d++ */
|
|
918 case LUPOSTINC: /* d++ */
|
463
|
919 if ((e3 = pexpr(e2))==e2) return e1;
|
462
|
920 if (car(e3)==LCONST) return e3;
|
503
|
921 return list4(car(e1),e3,caddr(e1),cadddr(e1));
|
462
|
922 #endif
|
|
923 case MUL: case UMUL:
|
|
924 case DIV: case UDIV:
|
|
925 case MOD: case UMOD:
|
|
926 case LSHIFT: case ULSHIFT: case RSHIFT: case URSHIFT:
|
|
927 case ADD: case SUB: case BAND: case EOR: case BOR: case CMP: case CMPGE:
|
|
928 case UCMP: case CMPEQ: case CMPNEQ: case UCMPGE:
|
|
929 #if FLOAT_CODE
|
|
930 case DMUL: case DDIV:
|
|
931 case DADD: case DSUB:
|
|
932 case DCMP: case DCMPGE: case DCMPEQ: case DCMPNEQ:
|
|
933 case FMUL: case FDIV:
|
|
934 case FADD: case FSUB:
|
|
935 case FCMP: case FCMPGE: case FCMPEQ: case FCMPNEQ:
|
|
936 #endif
|
|
937 #if LONGLONG_CODE
|
|
938 case LMUL: case LUMUL:
|
|
939 case LDIV: case LUDIV:
|
|
940 case LMOD: case LUMOD:
|
|
941 case LLSHIFT: case LULSHIFT: case LRSHIFT: case LURSHIFT:
|
|
942 case LADD: case LSUB: case LBAND: case LEOR: case LBOR: case LCMP:
|
|
943 #endif
|
501
|
944 return pbinop(car(e1),e2,caddr(e1));
|
528
|
945 case LCOND: case DCOND: case FCOND: case COND: case UCOND: case LUCOND:
|
463
|
946 e3 = pexpr(e2);
|
532
|
947 if (car(e3)==CONST) return
|
|
948 caddr(e1)? pexpr(cadr(e3)?caddr(e1):cadddr(e1)) :
|
|
949 pexpr(cadr(e3)?e3:cadddr(e1)); // GNU extension h?:g
|
|
950 return list4(car(e1),e3,pexpr(caddr(e1)),pexpr(cadddr(e1)));
|
462
|
951 case STASS:
|
|
952 return psassign(e1);
|
|
953 case ASS: case CASS: case SASS:
|
|
954 return passign(e1);
|
|
955 case SASSOP: case SUASSOP:
|
|
956 case ASSOP: case CASSOP: case CUASSOP:
|
|
957 return passop(e1);
|
|
958 #if FLOAT_CODE
|
|
959 case FASS: case DASS:
|
|
960 return pdassign(e1);
|
|
961 case DASSOP: case FASSOP:
|
|
962 return pdassop(e1);
|
|
963 #endif
|
|
964 #if LONGLONG_CODE
|
|
965 case LASS:
|
|
966 return plassign(e1);
|
|
967 case LASSOP: case LUASSOP:
|
|
968 return plassop(e1);
|
|
969 #endif
|
|
970 case ALLOCA:
|
501
|
971 return palloc(e2);
|
462
|
972 case BUILTINP:
|
463
|
973 return list2(CONST,is_const(pexpr(e2)));
|
462
|
974 case COMMA:
|
463
|
975 return pcomma(pexpr(e2),pexpr(caddr(e1)));
|
462
|
976 case RETURN:
|
|
977 case ENVIRONMENT:
|
|
978 case LCALL:
|
|
979 return e1;
|
502
|
980 // relational operator
|
|
981 case GT: case UGT: case GE: case UGE: case LT:
|
|
982 case ULT: case LE: case ULE:
|
526
|
983 case LOP+GT: case LOP+UGT: case LOP+GE: case LOP+UGE: case LOP+LT:
|
|
984 case LOP+ULT: case LOP+LE: case LOP+ULE:
|
502
|
985 case DOP+GT: case DOP+GE: case DOP+LT: case DOP+LE:
|
|
986 case FOP+GT: case FOP+GE: case FOP+LT: case FOP+LE:
|
|
987 case FOP+EQ: case FOP+NEQ:
|
|
988 case EQ: case NEQ: case DOP+EQ: case DOP+NEQ:
|
526
|
989 case LOP+EQ: case LOP+NEQ:
|
502
|
990 return prexpr(car(e1),cadr(e1),caddr(e1));
|
526
|
991 case LAND:
|
|
992 return pland(car(e1),cadr(e1),caddr(e1));
|
|
993 case LOR:
|
|
994 return plor(car(e1),cadr(e1),caddr(e1));
|
462
|
995 #if BIT_FIELD_CODE
|
|
996 case RBIT_FIELD:
|
|
997 return prbit_field(e1);
|
|
998 case BASS:
|
|
999 return pbassign(e1);
|
|
1000 case BPREINC:
|
|
1001 case BPOSTINC:
|
|
1002 case BASSOP:
|
|
1003 return pbassop(e1);
|
|
1004 #endif
|
|
1005 #if ASM_CODE
|
|
1006 case ASM:
|
|
1007 return list3(ASM,list4(
|
501
|
1008 car(e2),cadr(e2),caddr(e2),cadddr(e2)),
|
|
1009 caddr(e1));
|
462
|
1010 #endif
|
|
1011 case ST_DECL: return p_decl(e1);
|
|
1012 case ST_IF: return p_if(e1);
|
|
1013 case ST_DO: return p_do(e1);
|
|
1014 case ST_WHILE: return p_while(e1);
|
|
1015 case ST_FOR: return p_for(e1);
|
|
1016 case ST_SWITCH: return p_switch(e1);
|
|
1017 case ST_COMP: return p_comp(e1);
|
|
1018 case ST_BREAK: return p_break(e1);
|
|
1019 case ST_CONTINUE: return p_continue(e1);
|
|
1020 case ST_CASE: return p_case(e1);
|
|
1021 case ST_DEFAULT: return p_default(e1);
|
|
1022 case ST_RETURN: return p_return(e1);
|
|
1023 case ST_GOTO: return p_goto(e1);
|
|
1024 case ST_ASM: return p_asm(e1);
|
|
1025 case ST_LABEL: return p_label(e1);
|
|
1026 case ST_COMMENT: return p_comment(e1);
|
|
1027 default:
|
551
|
1028 error(-1);
|
462
|
1029 return p_bool(e1);
|
|
1030 }
|
|
1031 return VOID;
|
|
1032 }
|
|
1033
|
463
|
1034 #define round4(i) ((i+(SIZE_OF_INT-1))&~(SIZE_OF_INT-1))
|
|
1035
|
531
|
1036 // extern int lreg_count;
|
530
|
1037
|
463
|
1038 extern int
|
|
1039 gen_inline(int e)
|
462
|
1040 {
|
514
|
1041 // these saved value should be some struct
|
|
1042 int sretlabel;
|
|
1043 NMTBL *sfnptr;
|
552
|
1044 int svartable;
|
|
1045 int sretcont;
|
513
|
1046 int scslabel = cslabel;
|
463
|
1047 int sdisp = pdisp;
|
552
|
1048 int sret_register;
|
|
1049 int sret_reg_mode;
|
|
1050 int sinline_lvars;
|
|
1051 int slfree;
|
531
|
1052 // int slreg_count=lreg_count;
|
513
|
1053
|
463
|
1054 int narg,arg;
|
|
1055 NMTBL *n = (NMTBL*)cadr(cadr(e));
|
|
1056 int e1 = attr_value(n,INLINE);
|
500
|
1057 int parse = car(e1); // inline parse tree
|
519
|
1058 int arg_disp = cadr(e1); // number of arguments
|
552
|
1059 NMTBL *local_statics = (NMTBL*)cadddr(e1); // local static list
|
|
1060 int e2,e3,t,e4,e5,dots;
|
508
|
1061 int ret_type = function_type(cadddr(e),&dots);
|
526
|
1062 int fargtype;
|
|
1063 NMTBL *anptr;
|
463
|
1064
|
552
|
1065 checkret();
|
|
1066 checkjmp(-1);
|
|
1067
|
|
1068 svartable = pvartable;
|
|
1069 sretcont = retcont;
|
|
1070 scslabel = cslabel;
|
|
1071 sdisp = pdisp;
|
|
1072 sret_register = ret_register;
|
|
1073 sret_reg_mode = ret_reg_mode;
|
|
1074 sinline_lvars = inline_lvars;
|
|
1075 slfree=lfree;
|
|
1076 // int slreg_count=lreg_count;
|
514
|
1077
|
|
1078 sretlabel = retlabel;
|
|
1079 sfnptr = fnptr;
|
513
|
1080 retcont = 0;
|
|
1081 cslabel = -1;
|
|
1082 retpending = 0;
|
514
|
1083 ret_reg_mode = 0;
|
|
1084 ret_register = 5555;
|
527
|
1085 inline_lvars = 0;
|
514
|
1086 retlabel = fwdlabel();
|
513
|
1087
|
511
|
1088 enter_scope(); // to make label scope happy
|
|
1089
|
510
|
1090 fnptr = n; // st_return see this
|
503
|
1091 pvartable = p_vartable(e,arg_disp,caddr(e1));
|
526
|
1092
|
|
1093 /* function arguments type */
|
|
1094 fargtype = n->dsp; // we cannot do destruct reverse here
|
|
1095
|
463
|
1096 /* inline function arguments */
|
|
1097 narg = 0;
|
552
|
1098 if (!fargtype) {
|
|
1099 goto no_args; // wrong number of arguments
|
|
1100 }
|
|
1101 for (e3 = e5 = reverse0(caddr(e)); e3; e3 = cadr(e3)) {
|
526
|
1102 anptr = (NMTBL*)caddr(fargtype);
|
552
|
1103 if (!anptr) break; // should not happen?
|
500
|
1104 t=caddr(e3); // type
|
|
1105 e4 = car(e3);
|
524
|
1106 if (0 && is_const(e4) /* ||(is_memory(e3)&&is_readonly(e3)) */ ) {
|
500
|
1107 heap[pdisp+narg]=e4;
|
463
|
1108 } else {
|
509
|
1109 arg = heap[pdisp+narg]=list3(LVAR,new_lvar(size(t)),0);
|
527
|
1110 inline_lvars = glist2(arg,inline_lvars);
|
509
|
1111 // should contain correct argument variable name
|
529
|
1112 // if (anptr) printf("## var %s\n",anptr->nm);
|
|
1113 // else printf("## var 0\n");
|
549
|
1114 g_expr_u(assign_expr0(arg,e4,anptr->ty,t));
|
463
|
1115 }
|
500
|
1116 narg ++;
|
526
|
1117 fargtype = cadr(fargtype);
|
463
|
1118 }
|
552
|
1119 caddr(e) = reverse0(e5); // make it normal
|
|
1120 no_args:
|
511
|
1121 e2 = pexpr(parse);
|
463
|
1122 pdisp = sdisp;
|
464
|
1123 pvartable = svartable;
|
513
|
1124
|
|
1125 if (ret_type!=VOID)
|
|
1126 g_expr0(e2);
|
|
1127 else
|
|
1128 g_expr_u(e2);
|
524
|
1129 checkret();
|
513
|
1130 fwddef(retlabel);
|
514
|
1131 control=1;
|
513
|
1132
|
|
1133 if (retcont) error(STERR); // inline can't handle return/environment
|
510
|
1134
|
511
|
1135 leave_scope();
|
552
|
1136 if (local_statics && local_statics != &null_nptr) {
|
|
1137 // append our local static variables to the parent list
|
|
1138 n = local_statics;
|
|
1139 while(n->next != &null_nptr) n=n->next;
|
|
1140 n->next = local_static_list; local_static_list = local_statics;
|
|
1141 cadddr(e1) = 0; // prevent duplicate initialize
|
|
1142 }
|
527
|
1143 while(inline_lvars) {
|
|
1144 int e;
|
|
1145 int l = car(inline_lvars);
|
|
1146 switch(car(l)) {
|
|
1147 case LVAR: free_lvar(cadr(l)); break;
|
|
1148 case REGISTER: case DREGISTER:
|
|
1149 case FREGISTER: case LREGISTER:
|
|
1150 free_register(cadr(l));
|
|
1151 }
|
|
1152 e = cadr(inline_lvars);
|
|
1153 free_glist2(inline_lvars);
|
|
1154 inline_lvars = e;
|
|
1155 }
|
513
|
1156 fnptr = sfnptr;
|
|
1157 retlabel = sretlabel;
|
|
1158 retcont = sretcont;
|
|
1159 cslabel = scslabel;
|
514
|
1160 ret_register = sret_register;
|
|
1161 ret_reg_mode = sret_reg_mode;
|
527
|
1162 inline_lvars = sinline_lvars;
|
528
|
1163 lfree=slfree;
|
513
|
1164
|
531
|
1165 // if (slreg_count!=lreg_count && lreg_count>0) {
|
|
1166 // printf("## lreg_count %d != %d\n", slreg_count,lreg_count);
|
|
1167 // }
|
530
|
1168
|
508
|
1169 return ret_type;
|
462
|
1170 }
|
|
1171
|
|
1172 /* end */
|