mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 00:19:58 +08:00
trans.h (struct gfc_ss_info): New field refcount.
* trans.h (struct gfc_ss_info): New field refcount. * trans-array.c (free_ss_info): Decrement refcount. Return early if still non-zero. (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Increment refcount. From-SVN: r180883
This commit is contained in:
parent
f28cd38e36
commit
c7bf4f1e64
@ -1,3 +1,11 @@
|
||||
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
* trans.h (struct gfc_ss_info): New field refcount.
|
||||
* trans-array.c (free_ss_info): Decrement refcount. Return early if
|
||||
still non-zero.
|
||||
(gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Increment
|
||||
refcount.
|
||||
|
||||
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
* trans-array.c (gfc_trans_create_temp_array): Move invariant condition
|
||||
|
@ -489,6 +489,11 @@ gfc_free_ss_chain (gfc_ss * ss)
|
||||
static void
|
||||
free_ss_info (gfc_ss_info *ss_info)
|
||||
{
|
||||
ss_info->refcount--;
|
||||
if (ss_info->refcount > 0)
|
||||
return;
|
||||
|
||||
gcc_assert (ss_info->refcount == 0);
|
||||
free (ss_info);
|
||||
}
|
||||
|
||||
@ -532,6 +537,7 @@ gfc_get_array_ss (gfc_ss *next, gfc_expr *expr, int dimen, gfc_ss_type type)
|
||||
int i;
|
||||
|
||||
ss_info = gfc_get_ss_info ();
|
||||
ss_info->refcount++;
|
||||
ss_info->type = type;
|
||||
ss_info->expr = expr;
|
||||
|
||||
@ -556,6 +562,7 @@ gfc_get_temp_ss (tree type, tree string_length, int dimen)
|
||||
int i;
|
||||
|
||||
ss_info = gfc_get_ss_info ();
|
||||
ss_info->refcount++;
|
||||
ss_info->type = GFC_SS_TEMP;
|
||||
ss_info->string_length = string_length;
|
||||
ss_info->data.temp.type = type;
|
||||
@ -580,6 +587,7 @@ gfc_get_scalar_ss (gfc_ss *next, gfc_expr *expr)
|
||||
gfc_ss_info *ss_info;
|
||||
|
||||
ss_info = gfc_get_ss_info ();
|
||||
ss_info->refcount++;
|
||||
ss_info->type = GFC_SS_SCALAR;
|
||||
ss_info->expr = expr;
|
||||
|
||||
|
@ -185,6 +185,7 @@ gfc_ss_type;
|
||||
|
||||
typedef struct gfc_ss_info
|
||||
{
|
||||
int refcount;
|
||||
gfc_ss_type type;
|
||||
gfc_expr *expr;
|
||||
tree string_length;
|
||||
|
Loading…
Reference in New Issue
Block a user