#include "target.h"
#include "cgraph.h"
#include "diagnostic.h"
+#include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
#include "timevar.h"
#include "params.h"
#include "fibheap.h"
static inline struct field_access_site *
make_field_acc_node (void)
{
- int size = sizeof (struct field_access_site);
-
- return (struct field_access_site *) xcalloc (1, size);
+ return XCNEW (struct field_access_site);
}
/* This function returns the structure field access, defined by STMT,
{
void **slot;
- acc = (struct access_site *) xmalloc (sizeof (struct access_site));
+ acc = XNEW (struct access_site);
acc->stmt = stmt;
if (!is_gimple_debug (stmt))
acc->vars = VEC_alloc (tree, heap, 10);
for now just reset all debug stmts referencing objects that have
been peeled. */
gimple_debug_bind_reset_value (stmt);
+ update_stmt (stmt);
break;
default:
{
new_var node;
- node = (new_var) xmalloc (sizeof (struct new_var_data));
+ node = XNEW (struct new_var_data);
node->orig_var = var;
node->new_vars = VEC_alloc (tree, heap, VEC_length (tree, str->new_types));
return node;
tree t = TYPE_FIELDS (struct_decl);
int idx = 0;
- list =
- (struct field_entry *) xmalloc (num_fields * sizeof (struct field_entry));
+ list = XNEWVEC (struct field_entry, num_fields);
for (idx = 0 ; t; t = TREE_CHAIN (t), idx++)
if (TREE_CODE (t) == FIELD_DECL)
{
void **slot;
- fallocs = (fallocs_t)
- xmalloc (sizeof (struct func_alloc_sites));
+ fallocs = XNEW (struct func_alloc_sites);
fallocs->func = fn_decl;
fallocs->allocs = VEC_alloc (alloc_site_t, heap, 1);
slot = htab_find_slot_with_hash (alloc_sites, fn_decl,
static void
gen_cluster (sbitmap fields, d_str str)
{
- struct field_cluster *crr_cluster = NULL;
+ struct field_cluster *crr_cluster = XCNEW (struct field_cluster);
- crr_cluster =
- (struct field_cluster *) xcalloc (1, sizeof (struct field_cluster));
crr_cluster->sibling = str->struct_clustering;
str->struct_clustering = crr_cluster;
crr_cluster->fields_in_cluster = fields;
static void
peel_field (int i, d_str ds)
{
- struct field_cluster *crr_cluster = NULL;
+ struct field_cluster *crr_cluster = XCNEW (struct field_cluster);
- crr_cluster =
- (struct field_cluster *) xcalloc (1, sizeof (struct field_cluster));
crr_cluster->sibling = ds->struct_clustering;
ds->struct_clustering = crr_cluster;
crr_cluster->fields_in_cluster =
create_new_accesses_for_func ();
update_ssa (TODO_update_ssa);
cleanup_tree_cfg ();
+ cgraph_rebuild_references ();
/* Free auxiliary data representing local variables. */
free_new_vars_htab (new_local_vars);