aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurynas Biveinis <laurynas.biveinis@gmail.com>2006-08-17 15:42:57 +0000
committerLaurynas Biveinis <laurynas.biveinis@gmail.com>2006-08-17 15:42:57 +0000
commitba095fa4a6541f161df7e90b3389d9ba2304c557 (patch)
treeca5c1f702ea2834ad5b57ca452d5dedb50154970
parentcd23470fdb8db80ba669906e7fbed1f71ce7092c (diff)
Gengtype fixes
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/boehms-gc@116225 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/gengtype.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 7c533d9b0ad..d8ae602923d 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1099,7 +1099,7 @@ open_base_files (void)
{
/* The order of files here matters very much. */
static const char *const ifiles [] = {
- "config.h", "system.h", "coretypes.h", "tm.h", "varray.h",
+ "config.h", "system.h", "coretypes.h", "tm.h", "varray.h",
"hashtab.h", "splay-tree.h", "obstack.h", "bitmap.h", "input.h",
"tree.h", "rtl.h", "function.h", "insn-config.h", "expr.h",
"hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
@@ -2448,16 +2448,17 @@ write_enum_defn (type_p structures, type_p param_structs)
oprintf (header_file, " gt_ggc_e_");
output_mangled_typename (header_file, s);
- oprintf (header_file, ", \n");
+ oprintf (header_file, ",\n");
}
for (s = param_structs; s; s = s->next)
{
oprintf (header_file, " gt_e_");
output_mangled_typename (header_file, s);
- oprintf (header_file, ", \n");
+ oprintf (header_file, ",\n");
}
+ oprintf (header_file, " gt_types_enum_atomic_data,\n");
oprintf (header_file, " gt_types_enum_last\n");
oprintf (header_file, "};\n");
}
@@ -2482,7 +2483,7 @@ write_typed_alloc_defns (type_p structures)
if (strcmp (o->name, "size_not_fixed") == 0)
have_size = 1;
- if (s->kind == TYPE_STRUCT)
+ if (s->kind == TYPE_STRUCT || s->kind == TYPE_LANG_STRUCT)
type_kind = "struct ";
else if (s->kind == TYPE_UNION)
type_kind = "union ";
@@ -2508,6 +2509,26 @@ write_typed_alloc_defns (type_p structures)
else
oprintf (header_file, ", sizeof (%s%s))\n",
type_kind, s->u.s.tag);
+
+ oprintf (header_file, "#define ggc_alloc_vec_%s(%sn) \\\n",
+ s->u.s.tag, (have_size ? "SIZE, " : ""));
+ oprintf (header_file, " ggc_alloc_typed(gt_ggc_e_");
+ output_mangled_typename (header_file, s);
+ if (have_size)
+ oprintf (header_file, ", (n) * SIZE)\n");
+ else
+ oprintf (header_file, ", (n) * sizeof (%s%s))\n",
+ type_kind, s->u.s.tag);
+
+ oprintf (header_file, "#define ggc_alloc_cleared_vec_%s(%sn) \\\n",
+ s->u.s.tag, (have_size ? "SIZE, " : ""));
+ oprintf (header_file, " ggc_alloc_cleared_typed(gt_ggc_e_");
+ output_mangled_typename (header_file, s);
+ if (have_size)
+ oprintf (header_file, ", (n) * SIZE)\n");
+ else
+ oprintf (header_file, ", (n) * sizeof (%s%s))\n",
+ type_kind, s->u.s.tag);
}
oprintf (header_file,
"\n/* Typed allocation for known typedefs. */\n");
@@ -2534,6 +2555,20 @@ write_typed_alloc_defns (type_p structures)
output_mangled_typename (header_file, s);
oprintf (header_file, ", sizeof (%s%s))\n",
s->kind == TYPE_STRUCT ? "struct " : "", s->u.s.tag);
+
+ oprintf (header_file, "#define ggc_alloc_vec_%s(%sn) \\\n",
+ p->name, s->kind == TYPE_STRUCT ? "" : "__SIZE, ");
+ oprintf (header_file, " ggc_alloc_typed(gt_ggc_e_");
+ output_mangled_typename (header_file, s);
+ oprintf (header_file, ", (n) * sizeof (%s%s))\n",
+ s->kind == TYPE_STRUCT ? "struct " : "", s->u.s.tag);
+
+ oprintf (header_file, "#define ggc_alloc_cleared_vec_%s(%sn) \\\n",
+ p->name, s->kind == TYPE_STRUCT ? "" : "__SIZE, ");
+ oprintf (header_file, " ggc_alloc_cleared_typed(gt_ggc_e_");
+ output_mangled_typename (header_file, s);
+ oprintf (header_file, ", (n) * sizeof (%s%s))\n",
+ s->kind == TYPE_STRUCT ? "struct " : "", s->u.s.tag);
}
}