Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.16
 
1.17
 
MAIN:ragge:20110627115025
 
local.c
_>3535 
 3636 # include "pass1.h"
 3737 
<>38 -/*      this file contains code which is dependent on the target machine */
  38+static void r1arg(NODE *p, NODE *q);
3939 
<>40 -#if 0
 41 -NODE *
 42 -cast( p, t ) register NODE *p; TWORD t; {
 43 -        /* cast node p to type t */
4440 
<>45 -        p = buildtree( CAST, block( NAME, NIL, NIL, t, 0, (int)t ), p );
 46 -        p->left->op = FREE;
 47 -        p->op = FREE;
 48 -        return( p->right );
 49 -        }
 50 -#endif
  41+/*      this file contains code which is dependent on the target machine */
5142 
 5243 NODE *
 5344 clocal(p) NODE *p; {
     
 !
186177                 break;
 187178 
 188179         case STCALL:
<>189 -        case CALL:
 190 -                /* Fix function call arguments. On vax, just add funarg */
 191 -                for (r = p->n_right; r->n_op == CM; r = r->n_left) {
 192 -                        if (r->n_right->n_op != STARG &&
 193 -                            r->n_right->n_op != FUNARG)
 194 -                                r->n_right = block(FUNARG, r->n_right, NIL,
 195 -                                    r->n_right->n_type, r->n_right->n_df,
 196 -                                    r->n_right->n_ap);
 197 -                }
 198 -                if (r->n_op != STARG && r->n_op != FUNARG) {
 199 -                        NODE *l = talloc();
 200 -                        *l = *r;
 201 -                        r->n_op = FUNARG; r->n_left = l; r->n_type = l->n_type;
 202 -                }
  180+                /* see if we have been here before */
  181+                for (r = p->n_right; r->n_op == CM; r = r->n_left)
  182+                        ;
  183+                if (r->n_op == ASSIGN)
  184+                        break;
  185+
  186+                /* FALLTHROUGH */
  187+        case USTCALL:
  188+                /* Allocate buffer on stack to bounce via */
  189+                /* create fake symtab here */
  190+                /* first check if we have been here before */
  191+                q = getsymtab("77fake", STEMP);
  192+                q->stype = BTYPE(p->n_type);
  193+                q->sdf = p->n_df;
  194+                q->sap = p->n_ap;
  195+                q->soffset = NOOFFSET;
  196+                q->sclass = AUTO;
  197+                oalloc(q, &autooff);
  198+                r1arg(p, buildtree(ADDROF, nametree(q), 0));
203199                 break;
 204200         }
 205201 
 206202         return(p);
 207203 }
 208204 
<> 205+/*
  206+ * Add R1 with the dest address as arg to a struct return call.
  207+ */
  208+static void
  209+r1arg(NODE *p, NODE *q)
  210+{
  211+        NODE *r;
  212+
  213+        r = block(REG, NIL, NIL, PTR|VOID, 0, 0);
  214+        regno(r) = R1;
  215+        r = buildtree(ASSIGN, r, q);
  216+        if (p->n_op == USTCALL) {
  217+                p->n_op = STCALL;
  218+                p->n_right = r;
  219+        } else if (p->n_right->n_op != CM) {
  220+                p->n_right = block(CM, r, p->n_right, INT, 0, 0);
  221+        } else {
  222+                for (q = p->n_right; q->n_left->n_op == CM; q = q->n_left)
  223+                        ;
  224+                q->n_left = block(CM, r, q->n_left, INT, 0, 0);
  225+        }
  226+}
  227+
<_209228 void
 210229 myp2tree(NODE *p)
 211230 {
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-01 09:51 +0200