diff options
author | Richard Henderson <rth@redhat.com> | 2003-09-10 12:16:20 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-09-10 12:16:20 -0700 |
commit | 25c84396dd1bfb44ff5365d8ff512f1233101dfd (patch) | |
tree | 56d08387c52a8a24e834f4ec5cb02b4cf7d17bf9 /gcc/cp | |
parent | 707691d877398ea53c48961368d24e06787ac43d (diff) | |
download | gcc-25c84396dd1bfb44ff5365d8ff512f1233101dfd.zip gcc-25c84396dd1bfb44ff5365d8ff512f1233101dfd.tar.gz gcc-25c84396dd1bfb44ff5365d8ff512f1233101dfd.tar.bz2 |
cgraph.h (struct cgraph_node): Rename lowered to analyzed.
* cgraph.h (struct cgraph_node): Rename lowered to analyzed.
* cgraphunit.c: Update to match.
(record_call_1): Rearrange. Call lang hook for language nodes.
(cgraph_analyze_function): Don't call lower_function.
* langhooks.h (struct lang_hooks_for_callgraph): Replace
lower_function with analyze_expr.
* langhooks-def.h: Update to match.
* langhooks.c (lhd_callgraph_analyze_expr): New.
* decl2.c (cxx_callgraph_analyze_expr): New, from corpse of
mark_member_pointers.
(lower_function): Remove.
* cp-tree.h: Update to match.
* cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New.
(LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove.
From-SVN: r71277
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 27 |
4 files changed, 22 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b36f7aa..918d5da 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2003-09-10 Richard Henderson <rth@redhat.com> + + * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of + mark_member_pointers. + (lower_function): Remove. + * cp-tree.h: Update to match. + * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New. + (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove. + 2003-09-09 Richard Henderson <rth@redhat.com> * semantics.c (expand_or_defer_fn): Update call to diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 527054c..e71d53a 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -163,10 +163,10 @@ static void cxx_initialize_diagnostics (diagnostic_context *); #undef LANG_HOOKS_EXPR_SIZE #define LANG_HOOKS_EXPR_SIZE cp_expr_size +#undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR +#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body -#undef LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION -#define LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION lower_function #undef LANG_HOOKS_MAKE_TYPE #define LANG_HOOKS_MAKE_TYPE cxx_make_type diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 394514d..8ab8c6c 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3806,7 +3806,7 @@ extern tree build_artificial_parm (tree, tree); extern tree get_guard (tree); extern tree get_guard_cond (tree); extern tree set_guard (tree); -extern void lower_function (tree); +extern tree cxx_callgraph_analyze_expr (tree *, int *, tree); /* XXX Not i18n clean. */ #define cp_deprecated(STR) \ diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8c68a02..8e2c6c7 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2557,10 +2557,15 @@ generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data) return 0; } -/* Callgraph code does not understand the member pointers. Mark the methods - referenced as used. */ -static tree -mark_member_pointers (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) +/* Called via LANGHOOK_CALLGRAPH_ANALYZE_EXPR. It is supposed to mark + decls referenced from frontend specific constructs; it will be called + only for language-specific tree nodes. + + Here we must deal with member pointers. */ + +tree +cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees, + tree from ATTRIBUTE_UNUSED) { tree t = *tp; @@ -2572,22 +2577,10 @@ mark_member_pointers (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) break; default: - /* Avoid useless walking of complex type and declaration nodes. */ - if (TYPE_P (t) || DECL_P (t)) - *walk_subtrees = 0; break; } - return 0; -} - -/* Called via LANGHOOK_CALLGRAPH_LOWER_FUNCTION. It is supposed to lower - frontend specific constructs that would otherwise confuse the middle end. */ -void -lower_function (tree fn) -{ - walk_tree_without_duplicates (&DECL_SAVED_TREE (fn), - mark_member_pointers, NULL); + return NULL; } /* This routine is called from the last rule in yyparse (). |