Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.156
 
1.157
 
MAIN:ragge:20070127082536
 
pftn.c
_>6767 
 6868 # include "pass1.h"
 6969 
<> 70+#include <string.h> /* XXX - for strcmp */
  71+
7072 struct symtab *spname;
 7173 struct symtab *cftnsp;
 7274 static int strunem;             /* currently parsed member type */
     
 !
17941796         return r;
 17951797 }
 17961798 
<> 1799+#ifndef NO_C_BUILTINS
  1800+/*
  1801+ * replace an alloca function with direct allocation on stack.
  1802+ * return a destination temp node.
  1803+ */
  1804+static NODE *
  1805+builtin_alloca(NODE *f, NODE *a)
  1806+{
  1807+        struct symtab *sp;
  1808+        NODE *t, *u;
17971809 
<> 1810+#ifdef notyet
  1811+        if (xnobuiltins)
  1812+                return NULL;
  1813+#endif
  1814+
  1815+        if (f->n_op != NAME)
  1816+                return NULL; /* not direct call */
  1817+        sp = f->n_sp;
  1818+
  1819+        /* XXX - strcmp is bad, use pointer comparision, redo someday */
  1820+        if (strcmp(sp->sname, "__builtin_alloca")) /* use GCC name */
  1821+                return NULL; /* not alloca */
  1822+
  1823+        if (a == NULL || a->n_op == CM) {
  1824+                uerror("wrong arg count for alloca");
  1825+                return NULL;
  1826+        }
  1827+        t = tempnode(0, VOID|PTR, 0, MKSUE(INT) /* XXX */);
  1828+        u = tempnode(t->n_lval, VOID|PTR, 0, MKSUE(INT) /* XXX */);
  1829+        spalloc(t, a, SZCHAR);
  1830+        tfree(f);
  1831+        return u;
  1832+}
  1833+#endif
  1834+
17981835 /*
 17991836  * Do prototype checking and add conversions before calling a function.
 18001837  * Argument f is function and a is a CM-separated list of arguments.
     
 !
18151852         /* First let MD code do something */
 18161853         calldec(f, a);
 18171854 
<> 1855+#ifndef NO_C_BUILTINS
  1856+        /* check for alloca */
  1857+        if ((w = builtin_alloca(f, a)))
  1858+                return w;
  1859+#endif
<_18181860         /*
 18191861          * Do some basic checks.
 18201862          */
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-11-01 02:57 +0100