/* Inline functions for tree-flow.h
- Copyright (C) 2001, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005, 2006, 2007, 2008 Free Software
+ Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
return fun->gimple_df->nonlocal_all;
}
-/* Hashtable of variables annotations. Used for static variables only;
- local variables have direct pointer in the tree node. */
-static inline htab_t
-gimple_var_anns (const struct function *fun)
-{
- return fun->gimple_df->var_anns;
-}
-
/* Initialize the hashtable iterator HTI to point to hashtable TABLE */
static inline void *
{
var_ann_t ann;
- if (!MTAG_P (t)
- && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
- {
- struct static_var_ann_d *sann
- = ((struct static_var_ann_d *)
- htab_find_with_hash (gimple_var_anns (cfun), t, DECL_UID (t)));
- if (!sann)
- return NULL;
- ann = &sann->ann;
- }
- else
- {
- if (!t->base.ann)
- return NULL;
- ann = (var_ann_t) t->base.ann;
- }
+ if (!t->base.ann)
+ return NULL;
+ ann = (var_ann_t) t->base.ann;
gcc_assert (ann->common.type == VAR_ANN);
return (ann) ? ann : create_stmt_ann (stmt);
}
+/* Set the uid of all non phi function statements. */
+static inline void
+set_gimple_stmt_uid (tree stmt, unsigned int uid)
+{
+ get_stmt_ann (stmt)->uid = uid;
+}
+
+/* Get the uid of all non phi function statements. */
+static inline unsigned int
+gimple_stmt_uid (tree stmt)
+{
+ return get_stmt_ann (stmt)->uid;
+}
+
+/* Get the number of the next statement uid to be allocated. */
+static inline unsigned int
+gimple_stmt_max_uid (struct function *fn)
+{
+ return fn->last_stmt_uid;
+}
+
+/* Set the number of the next statement uid to be allocated. */
+static inline void
+set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
+{
+ fn->last_stmt_uid = maxid;
+}
+
+/* Set the number of the next statement uid to be allocated. */
+static inline unsigned int
+inc_gimple_stmt_max_uid (struct function *fn)
+{
+ return fn->last_stmt_uid++;
+}
+
/* Return the annotation type for annotation ANN. */
static inline enum tree_ann_type
ann_type (tree_ann_t ann)
is_global_var (const_tree t)
{
if (MTAG_P (t))
- return (TREE_STATIC (t) || MTAG_GLOBAL (t));
+ return MTAG_GLOBAL (t);
else
return (TREE_STATIC (t) || DECL_EXTERNAL (t));
}
static inline bool
is_call_clobbered (const_tree var)
{
- if (!MTAG_P (var))
- return var_ann (var)->call_clobbered;
- else
- return bitmap_bit_p (gimple_call_clobbered_vars (cfun), DECL_UID (var));
+ return var_ann (var)->call_clobbered;
}
/* Mark variable VAR as being clobbered by function calls. */
mark_call_clobbered (tree var, unsigned int escape_type)
{
var_ann (var)->escape_mask |= escape_type;
- if (!MTAG_P (var))
- var_ann (var)->call_clobbered = true;
+ var_ann (var)->call_clobbered = true;
bitmap_set_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
}
ann->escape_mask = 0;
if (MTAG_P (var))
MTAG_GLOBAL (var) = 0;
- if (!MTAG_P (var))
- var_ann (var)->call_clobbered = false;
+ var_ann (var)->call_clobbered = false;
bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
}
if (USE_FROM_PTR (use_p) == use)
last_p = move_use_after_head (use_p, head, last_p);
}
- /* LInk iter node in after last_p. */
+ /* Link iter node in after last_p. */
if (imm->iter_node.prev != NULL)
delink_imm_use (&imm->iter_node);
link_imm_use_to_list (&(imm->iter_node), last_p);
var = SSA_NAME_VAR (var);
if (MTAG_P (var))
- return TREE_READONLY (var) && (TREE_STATIC (var) || MTAG_GLOBAL (var));
+ return false;
return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
}