Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.11
 
1.12
 
MAIN:ragge:20090619162843
 
code.c
_>346346         return bcon(0);
 347347 }
 348348 
<> 349+/*
  350+ * Create a tree that should be like the expression
  351+ *      ((long *)(l->gp_offset >= 48 ?
  352+ *          l->overflow_arg_area += 8, l->overflow_arg_area :
  353+ *          l->gp_offset += 8, l->reg_save_area + l->gp_offset))[-1]
  354+ */
  355+static NODE *
  356+bva(NODE *ap)
  357+{
  358+        NODE *cm1, *cm2, *gpo, *ofa, *l1, *qc;
  359+
  360+        ofa = structref(ccopy(ap), STREF, overflow_arg_area);
  361+        l1 = buildtree(PLUSEQ, ccopy(ofa), bcon(8));
  362+        cm1 = buildtree(COMOP, l1, ofa);
  363+
  364+        gpo = structref(ccopy(ap), STREF, gp_offset);
  365+        l1 = buildtree(PLUSEQ, ccopy(gpo), bcon(8));
  366+        cm2 = buildtree(COMOP, l1, buildtree(PLUS, ccopy(gpo),
  367+            structref(ccopy(ap), STREF, reg_save_area)));
  368+        qc = buildtree(QUEST,
  369+            buildtree(GE, gpo, bcon(48)),
  370+            buildtree(COLON, cm1, cm2));
  371+        l1 = block(NAME, NIL, NIL, LONG|PTR, 0, MKSUE(LONG));
  372+        l1 = buildtree(CAST, l1, qc);
  373+        nfree(l1->n_left);
  374+        nfree(l1);
  375+        return buildtree(UMUL, buildtree(PLUS, qc, bcon(-8)), NIL);
  376+}
  377+
349378 NODE *
<>350 -amd64_builtin_va_arg(NODE *f, NODE *a) { cerror("amd64_builtin_va_arg"); return NULL; }
  379+amd64_builtin_va_arg(NODE *f, NODE *a)
  380+{
  381+        NODE *ap, *r;
351382 
<> 383+        /* check num args and type */
  384+        if (a == NULL || a->n_op != CM || a->n_left->n_op == CM ||
  385+            !ISPTR(a->n_left->n_type) || a->n_right->n_op != TYPE)
  386+                goto bad;
  387+
  388+        ap = a->n_left;
  389+        if (ap->n_type <= ULONGLONG || ISPTR(ap->n_type)) {
  390+                /* type might be in general register */
  391+                /* we create a ?: construction of it */
  392+                r = bva(ap);
  393+        } else {
  394+                cerror("amd64_builtin_va_arg");
  395+                goto bad; /* XXX */
  396+        }
  397+        tfree(a);
  398+        tfree(f);
  399+        return r;
  400+bad:
  401+        uerror("bad argument to __builtin_va_arg");
  402+        return bcon(0);
  403+}
  404+
<_352405 NODE *
 353406 amd64_builtin_va_end(NODE *f, NODE *a) { cerror("amd64_builtin_va_end"); return NULL; }
 354407 
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-21 08:03 +0200