From 20168cf29dbef684cb40d4b196bc3df39d8e34ee Mon Sep 17 00:00:00 2001 From: dberlin Date: Thu, 22 Dec 2005 15:01:02 +0000 Subject: 2005-12-22 Daniel Berlin * ipa-reference.c (get_reference_vars_info_from_cgraph): Use function_ann. (get_local_reference_vars_info): Ditto. (get_global_reference_vars_info): Ditto. (analyze_function): Ditto. (clean_function): Ditto. * tree-dfa.c (create_function_ann): New function. * tree-flow-inline.h (var_ann): FUNCTION_DECL's don't have var_ann. (function_ann): New. (get_function_ann): Ditto. * tree-flow.h (tree_ann_type): Add FUNCTION_ANN. (struct var_ann_d): Move reference_vars_info to function annotation. (struct function_ann_d): New. (union tree_ann_d): Add function_ann. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108950 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-flow-inline.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/tree-flow-inline.h') diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 057b2496c1a..94e19720f7b 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -126,6 +126,7 @@ var_ann (tree t) { gcc_assert (t); gcc_assert (DECL_P (t)); + gcc_assert (TREE_CODE (t) != FUNCTION_DECL); gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN); return (var_ann_t) t->common.ann; @@ -140,6 +141,27 @@ get_var_ann (tree var) return (ann) ? ann : create_var_ann (var); } +/* Return the function annotation for T, which must be a FUNCTION_DECL node. + Return NULL if the function annotation doesn't already exist. */ +static inline function_ann_t +function_ann (tree t) +{ + gcc_assert (t); + gcc_assert (TREE_CODE (t) == FUNCTION_DECL); + gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN); + + return (function_ann_t) t->common.ann; +} + +/* Return the function annotation for T, which must be a FUNCTION_DECL node. + Create the function annotation if it doesn't exist. */ +static inline function_ann_t +get_function_ann (tree var) +{ + function_ann_t ann = function_ann (var); + return (ann) ? ann : create_function_ann (var); +} + /* Return the statement annotation for T, which must be a statement node. Return NULL if the statement annotation doesn't exist. */ static inline stmt_ann_t -- cgit v1.2.3