aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2006-12-20 23:40:48 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2006-12-20 22:40:48 +0000
commitadb6509f4b75e929a237ded6d182f8524697fedf (patch)
tree43db620bf4a68210816d01661abe142a49165b70 /gcc/tree-flow-inline.h
parent0fd212e1bd1d3039be765ac7344c23b7b14e3585 (diff)
downloadgcc-adb6509f4b75e929a237ded6d182f8524697fedf.zip
gcc-adb6509f4b75e929a237ded6d182f8524697fedf.tar.gz
gcc-adb6509f4b75e929a237ded6d182f8524697fedf.tar.bz2
tree-flow-inline.h (gimple_var_anns): New function.
* tree-flow-inline.h (gimple_var_anns): New function. (var_ann): Use hashtable for static functions. * tree-dfa.c (create_var_ann): Likewise. * tree-ssa.c (var_ann_eq, var_ann_hash): New functions. (init_tree_ssa): Initialize var anns. (delete_tree_ssa): Delete var anns; also clear out gimple_df. * tree-flow.h (struct static_var_ann_d): New structure. (gimple_df): Add var_anns. From-SVN: r120089
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index e2b4f97..d87adc3 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -91,6 +91,15 @@ gimple_nonlocal_all (struct function *fun)
gcc_assert (fun && fun->gimple_df);
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 (struct function *fun)
+{
+ return fun->gimple_df->var_anns;
+}
+
/* Initialize the hashtable iterator HTI to point to hashtable TABLE */
static inline void *
@@ -194,6 +203,16 @@ var_ann (tree t)
gcc_assert (t);
gcc_assert (DECL_P (t));
gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
+ if (TREE_STATIC (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;
+ gcc_assert (sann->ann.common.type = VAR_ANN);
+ return &sann->ann;
+ }
gcc_assert (!t->base.ann
|| t->base.ann->common.type == VAR_ANN);