diff options
author | Andrew Haley <aph@redhat.com> | 2003-10-06 13:50:41 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2003-10-06 13:50:41 +0000 |
commit | 83d865c57c34520403cdd160c289b3c5e6287805 (patch) | |
tree | 1648237777c5c056de49de22c4c8ee760de29466 /gcc | |
parent | 75f604438c2fec75b9cca6e4917679d5250babb1 (diff) | |
download | gcc-83d865c57c34520403cdd160c289b3c5e6287805.zip gcc-83d865c57c34520403cdd160c289b3c5e6287805.tar.gz gcc-83d865c57c34520403cdd160c289b3c5e6287805.tar.bz2 |
tree.c (get_callee_fndecl): Call lang_hooks.lang_get_callee_fndecl.
2003-10-06 Andrew Haley <aph@redhat.com>
* tree.c (get_callee_fndecl): Call
lang_hooks.lang_get_callee_fndecl.
* langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): New.
(lhd_get_callee_fndecl): New.
From-SVN: r72150
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/langhooks-def.h | 3 | ||||
-rw-r--r-- | gcc/langhooks.h | 3 | ||||
-rw-r--r-- | gcc/tree.c | 7 |
4 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 401de25..d36ae3a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-10-06 Andrew Haley <aph@redhat.com> + + * tree.c (get_callee_fndecl): Call + lang_hooks.lang_get_callee_fndecl. + * langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): New. + (lhd_get_callee_fndecl): New. + 2003-10-06 Andrew Pinski <apinski@apple.com> * config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index f8ecc8b..cf24160 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -67,6 +67,7 @@ extern void lhd_register_builtin_type (tree, const char *); extern bool lhd_decl_ok_for_sibcall (tree); extern tree lhd_expr_size (tree); extern bool lhd_decl_uninit (tree); +extern tree lhd_get_callee_fndecl (tree); extern size_t lhd_tree_size (enum tree_code); /* Declarations of default tree inlining hooks. */ @@ -119,6 +120,7 @@ extern tree lhd_callgraph_analyze_expr (tree *, int *, tree); #define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing #define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function #define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name +#define LANG_HOOKS_GET_CALLEE_FNDECL lhd_return_null_tree #define LANG_HOOKS_EXPR_SIZE lhd_expr_size #define LANG_HOOKS_DECL_UNINIT lhd_decl_uninit #define LANG_HOOKS_TREE_SIZE lhd_tree_size @@ -297,6 +299,7 @@ extern int lhd_tree_dump_type_quals (tree); LANG_HOOKS_PRINT_TYPE, \ LANG_HOOKS_PRINT_IDENTIFIER, \ LANG_HOOKS_DECL_PRINTABLE_NAME, \ + LANG_HOOKS_GET_CALLEE_FNDECL, \ LANG_HOOKS_PRINT_ERROR_FUNCTION, \ LANG_HOOKS_EXPR_SIZE, \ LANG_HOOKS_DECL_UNINIT, \ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 4887f6d..cb5941f 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -378,6 +378,9 @@ struct lang_hooks types in C++. */ const char *(*decl_printable_name) (tree decl, int verbosity); + /* Given a CALL_EXPR, return a function decl that is its target. */ + tree (*lang_get_callee_fndecl) (tree); + /* Called by report_error_function to print out function name. */ void (*print_error_function) (struct diagnostic_context *, const char *); @@ -4449,9 +4449,10 @@ get_callee_fndecl (tree call) if (TREE_CODE (addr) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL) return TREE_OPERAND (addr, 0); - - /* We couldn't figure out what was being called. */ - return NULL_TREE; + + /* We couldn't figure out what was being called. Maybe the front + end has some idea. */ + return (*lang_hooks.lang_get_callee_fndecl) (call); } /* Print debugging information about tree nodes generated during the compile, |