diff options
author | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-12-22 15:01:02 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-12-22 15:01:02 +0000 |
commit | 3bfdb124af2ec89d718bfb95824c5f03ec057060 (patch) | |
tree | d35b07b258135f64556be040612caee313e68554 /gcc/tree-flow-inline.h | |
parent | 1052bd544ead1ce3d9d4e43cb3d90fb40a84a890 (diff) | |
download | gcc-3bfdb124af2ec89d718bfb95824c5f03ec057060.zip gcc-3bfdb124af2ec89d718bfb95824c5f03ec057060.tar.gz gcc-3bfdb124af2ec89d718bfb95824c5f03ec057060.tar.bz2 |
ipa-reference.c (get_reference_vars_info_from_cgraph): Use function_ann.
2005-12-22 Daniel Berlin <dberlin@dberlin.org>
* 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.
From-SVN: r108950
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r-- | gcc/tree-flow-inline.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 057b249..94e1972 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 |