diff options
| author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-22 15:01:02 +0000 |
|---|---|---|
| committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-22 15:01:02 +0000 |
| commit | 20168cf29dbef684cb40d4b196bc3df39d8e34ee (patch) | |
| tree | d35b07b258135f64556be040612caee313e68554 /gcc/tree-flow-inline.h | |
| parent | 3d6b8be710445a7a01af0b657ea2e47c6a3c6670 (diff) | |
| download | ppe42-gcc-20168cf29dbef684cb40d4b196bc3df39d8e34ee.tar.gz ppe42-gcc-20168cf29dbef684cb40d4b196bc3df39d8e34ee.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108950 138bc75d-0d04-0410-961f-82ee72b054a4
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 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 |

