summaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-20 22:40:48 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-20 22:40:48 +0000
commitf5ab006bf3e5e6f8e8036e036d8bd1b151c82f60 (patch)
tree43db620bf4a68210816d01661abe142a49165b70 /gcc/tree-flow-inline.h
parent44753b5af6138f98260a844f11f88969abc33c05 (diff)
downloadgcc-f5ab006bf3e5e6f8e8036e036d8bd1b151c82f60.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120089 138bc75d-0d04-0410-961f-82ee72b054a4
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 e2b4f979140..d87adc39112 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);