Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.173
 
1.174
 
MAIN:ragge:20070930203323
 
pftn.c
_>20272027         uerror("bad argument to __builtin_stdarg_start");
 20282028         return bcon(0);
 20292029 }
<> 2030+
  2031+static NODE *
  2032+builtin_pcc_va_arg(NODE *f, NODE *a)
  2033+{
  2034+        NODE *p, *q, *r;
  2035+        int sz, nodnum;
  2036+
  2037+        /* check num args and type */
  2038+        if (a == NULL || a->n_op != CM || a->n_left->n_op == CM ||
  2039+            !ISPTR(a->n_left->n_type) || a->n_right->n_op != TYPE)
  2040+                goto bad;
  2041+
  2042+        /* create a copy to a temp node of current ap */
  2043+        p = tcopy(a->n_left);
  2044+        q = tempnode(0, p->n_type, p->n_df, p->n_sue);
  2045+        nodnum = q->n_lval;
  2046+        ecomp(buildtree(ASSIGN, q, p)); /* done! */
  2047+
  2048+        r = a->n_right;
  2049+        sz = tsize(r->n_type, r->n_df, r->n_sue)/SZCHAR;
  2050+        /* add one to ap */
  2051+#ifdef BACKAUTO
  2052+        ecomp(buildtree(PLUSEQ, a->n_left, bcon(sz)));
  2053+#else
  2054+        /* XXX fix this; wrong order */
  2055+        ecomp(buildtree(MINUSEQ, a->n_left, bcon(sz)));
  2056+#endif
  2057+
  2058+        nfree(a->n_right);
  2059+        nfree(a);
  2060+        nfree(f);
  2061+        r = tempnode(nodnum, r->n_type, r->n_df, r->n_sue);
  2062+        return r;
  2063+bad:
  2064+        uerror("bad argument to __builtin_pcc_va_arg");
  2065+        return bcon(0);
  2066+
  2067+}
  2068+
  2069+static NODE *
  2070+builtin_va_end(NODE *f, NODE *a)
  2071+{
  2072+        return bcon(0); /* nothing */
  2073+}
  2074+
  2075+static NODE *
  2076+builtin_va_copy(NODE *f, NODE *a)
  2077+{
  2078+        if (a == NULL || a->n_op != CM || a->n_left->n_op == CM)
  2079+                goto bad;
  2080+        tfree(f);
  2081+        f = buildtree(ASSIGN, a->n_left, a->n_right);
  2082+        nfree(a);
  2083+        return f;
  2084+
  2085+bad:
  2086+        uerror("bad argument to __builtin_va_copy");
  2087+        return bcon(0);
  2088+}
20302089 #endif /* TARGET_STDARGS */
 20312090 
 20322091 static struct bitable {
     
 !
20352094 } bitable[] = {
 20362095         { "__builtin_alloca", builtin_alloca },
 20372096         { "__builtin_stdarg_start", builtin_stdarg_start },
<>2038 -#ifdef notyet
20392097         { "__builtin_pcc_va_arg", builtin_pcc_va_arg },
 20402098         { "__builtin_va_end", builtin_va_end },
 20412099         { "__builtin_va_copy", builtin_va_copy },
<>2042 -#endif
20432100 #ifdef TARGET_BUILTINS
 20442101         TARGET_BUILTINS
 20452102 #endif
     
 !
21382195                 if (a == NULL)
 21392196                         goto build;
 21402197                 for (w = a; w->n_op == CM; w = w->n_left) {
<> 2198+                        if (w->n_right->n_op == TYPE)
  2199+                                uerror("type is not an argument");
21412200                         if (w->n_right->n_type != FLOAT)
 21422201                                 continue;
 21432202                         w->n_right = argcast(w->n_right, DOUBLE,
 21442203                             NULL, MKSUE(DOUBLE));
 21452204                 }
<> 2205+                if (a->n_op == TYPE)
  2206+                        uerror("type is not an argument");
<_21462207                 if (a->n_type == FLOAT) {
 21472208                         MKTY(a, DOUBLE, 0, 0);
 21482209                 }
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-08-23 13:29 +0200