/* Struct-reorg optimization.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Contributed by Olga Golovanevsky <olga@il.ibm.com>
(Initial version of this code was developed
by Caroline Tice and Mostafa Hagog.)
{
tree size_def_stmt = SSA_NAME_DEF_STMT (arg);
- /* If allocation statementt was of the form
+ /* If the allocation statement was of the form
D.2229_10 = <alloc_func> (D.2228_9);
then size_def_stmt can be D.2228_9 = num.3_8 * 8; */
/* This function checks whether the access ACC of structure type STR
- is of the form suitable for tranformation. If yes, it returns true.
+ is of the form suitable for transformation. If yes, it returns true.
False otherwise. */
static bool
}
/* This function returns the structure field access, defined by STMT,
- if it is aready in hashtable of function accesses F_ACCS. */
+ if it is already in hashtable of function accesses F_ACCS. */
static struct field_access_site *
is_in_field_accs (tree stmt, htab_t f_accs)
return 1;
}
-/* This funciton updates statements in STMT_LIST with BB info. */
+/* This function updates statements in STMT_LIST with BB info. */
static void
add_bb_info (basic_block bb, tree stmt_list)
htab_hash_pointer (decl));
}
-/* Given original varaiable ORIG_VAR, this function returns
+/* Given original variable ORIG_VAR, this function returns
new variable corresponding to it of NEW_TYPE type. */
static tree
case ENUMERAL_TYPE:
{
tree field1;
- /* Compare fields of struture. */
+ /* Compare fields of structure. */
for (field1 = TYPE_FIELDS (type1); field1;
field1 = TREE_CHAIN (field1))
{
/* This function returns a tree representing
the number of instances of structure STR_DECL allocated
- by allocation STMT. If new statments are generated,
+ by allocation STMT. If new statements are generated,
they are filled into NEW_STMTS_P. */
static tree
appropriate new name for the new variable. */
old_name = IDENTIFIER_POINTER (DECL_NAME (orig_decl));
- prefix = alloca (strlen (old_name) + 1);
+ prefix = XALLOCAVEC (char, strlen (old_name) + 1);
strcpy (prefix, old_name);
ASM_FORMAT_PRIVATE_NAME (new_name, prefix, i);
return get_identifier (new_name);
return 1;
}
-/* This function frees memory allocated for strcuture clusters,
+/* This function frees memory allocated for structure clusters,
starting from CLUSTER. */
static void
}
/* Currently we support only EQ_EXPR or NE_EXPR conditions.
- COND_STNT is a condition statement to check. */
+ COND_STMT is a condition statement to check. */
static bool
is_safe_cond_expr (tree cond_stmt)
ASM_FORMAT_PRIVATE_NAME(tmp_name, "struct", str_num);
len = strlen (tmp_name ? tmp_name : orig_name) + strlen ("_sub");
- prefix = alloca (len + 1);
+ prefix = XALLOCAVEC (char, len + 1);
memcpy (prefix, tmp_name ? tmp_name : orig_name,
strlen (tmp_name ? tmp_name : orig_name));
strcpy (prefix + strlen (tmp_name ? tmp_name : orig_name), "_sub");
}
/* This function adds to UNSUITABLE_TYPES those types that escape
- due to results of ipa-type-escpae analysis. See ipa-type-escpae.[c,h]. */
+ due to results of ipa-type-escape analysis. See ipa-type-escape.[c,h]. */
static void
exclude_escaping_types_1 (VEC (tree, heap) **unsuitable_types)
htab_traverse (dt.str->accs, exclude_from_accs, &dt);
}
-/* Collect accesses to the structure types that apear in basic bloack BB. */
+/* Collect accesses to the structure types that appear in basic block BB. */
static void
collect_accesses_in_bb (basic_block bb)
}
}
-/* This function generates cluster substructure that cointains FIELDS.
- The cluster added to the set of clusters of the structure SRT. */
+/* This function generates cluster substructure that contains FIELDS.
+ The cluster added to the set of clusters of the structure STR. */
static void
gen_cluster (sbitmap fields, d_str str)
add_structure (type);
/* Check function local variables. */
- for (var_list = fn->unexpanded_var_list; var_list;
+ for (var_list = fn->local_decls; var_list;
var_list = TREE_CHAIN (var_list))
{
var = TREE_VALUE (var_list);
}
set_cfun (NULL);
+ bitmap_obstack_release (NULL);
}
/* This function creates new global struct variables.