static int
struct_ptr_eq (const void *a, const void *b)
{
- const void * const * x = a;
- const void * const * y = b;
+ const void * const * x = (const void * const *) a;
+ const void * const * y = (const void * const *) b;
return *x == *y;
}
static hashval_t
struct_ptr_hash (const void *a)
{
- const void * const * x = a;
+ const void * const * x = (const void * const *) a;
return (size_t)*x >> 4;
}
gcc_assert (num >= 0);
gcc_assert (TREE_CODE (t) != RESX_EXPR);
- n = ggc_alloc (sizeof (*n));
+ n = GGC_NEW (struct throw_stmt_node);
n->stmt = t;
n->region_nr = num;
return -2;
n.stmt = t;
- p = htab_find (get_eh_throw_stmt_table (ifun), &n);
+ p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun),
+ &n);
return (p ? p->region_nr : -1);
}
struct finally_tree_node *n;
void **slot;
- n = xmalloc (sizeof (*n));
+ n = XNEW (struct finally_tree_node);
n->child = child;
n->parent = parent;
do
{
n.child = start;
- p = htab_find (finally_tree, &n);
+ p = (struct finally_tree_node *) htab_find (finally_tree, &n);
if (!p)
return true;
start = p->parent;
{
struct goto_queue_node tmp, *ret;
tmp.stmt = stmt;
- ret = bsearch (&tmp, tf->goto_queue, tf->goto_queue_active,
+ ret = (struct goto_queue_node *)
+ bsearch (&tmp, tf->goto_queue, tf->goto_queue_active,
sizeof (struct goto_queue_node), goto_queue_cmp);
return (ret ? ret->repl_stmt : NULL);
}
size = (size ? size * 2 : 32);
tf->goto_queue_size = size;
tf->goto_queue
- = xrealloc (tf->goto_queue, size * sizeof (struct goto_queue_node));
+ = XRESIZEVEC (struct goto_queue_node, tf->goto_queue, size);
}
q = &tf->goto_queue[active];
struct goto_queue_node *q, *qe;
tree return_val = NULL;
int return_index, index;
- struct
+ struct labels_s
{
struct goto_queue_node *q;
tree label;
} *labels;
return_index = VEC_length (tree, tf->dest_array);
- labels = xcalloc (sizeof (*labels), return_index + 1);
+ labels = XCNEWVEC (struct labels_s, return_index + 1);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
}
}
-static void
+static unsigned int
lower_eh_constructs (void)
{
struct leh_state null_state;
htab_delete (finally_tree);
collect_eh_region_array ();
+ return 0;
}
struct tree_opt_pass pass_lower_eh =
TV_TREE_EH, /* tv_id */
PROP_gimple_lcf, /* properties_required */
PROP_gimple_leh, /* properties_provided */
- PROP_gimple_lcf, /* properties_destroyed */
+ 0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func, /* todo_flags_finish */
0 /* letter */
tree stmt, lab;
basic_block src, dst;
- stmt = data;
+ stmt = (tree) data;
lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt);
basic_block src, dst;
edge e;
- stmt = data;
+ stmt = (tree) data;
lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt);
return false;
}
+
+#ifdef ENABLE_CHECKING
+static int
+verify_eh_throw_stmt_node (void **slot, void *data ATTRIBUTE_UNUSED)
+{
+ struct throw_stmt_node *node = (struct throw_stmt_node *)*slot;
+
+ gcc_assert (node->stmt->common.ann == NULL);
+ return 1;
+}
+
+void
+verify_eh_throw_table_statements (void)
+{
+ if (!get_eh_throw_stmt_table (cfun))
+ return;
+ htab_traverse (get_eh_throw_stmt_table (cfun),
+ verify_eh_throw_stmt_node,
+ NULL);
+}
+
+#endif