* tree.c (get_callee_fndecl): Don't call the language hook.
* langhooks.h (lang_hooks): Remove lang_get_callee_fndecl.
* langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): Kill.
(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_GET_CALLEE_FNDECL.
2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR objc/37460
* objc-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
* objc-act.h (objc_get_callee_fndecl): Remove prototype.
* objc-act.c (objc_get_callee_fndecl): Kill.
2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
* lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
(java_get_callee_fndecl): Kill.
2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR objc/37460
* objcp-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140430
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * tree.c (get_callee_fndecl): Don't call the language hook.
+ * langhooks.h (lang_hooks): Remove lang_get_callee_fndecl.
+ * langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): Kill.
+ (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_GET_CALLEE_FNDECL.
+
2008-09-17 Jakub Jelinek <jakub@redhat.com>
* tree.c (protected_set_expr_location): Don't unnecessarily
+2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
+ (java_get_callee_fndecl): Kill.
+
2008-09-17 Jan Hubicka <jh@suse.cz>
PR c++/18071
static bool java_dump_tree (void *, tree);
static void dump_compound_expr (dump_info_p, tree);
static bool java_decl_ok_for_sibcall (const_tree);
-static tree java_get_callee_fndecl (const_tree);
static enum classify_record java_classify_record (tree type);
#undef LANG_HOOKS_DECL_OK_FOR_SIBCALL
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL java_decl_ok_for_sibcall
-#undef LANG_HOOKS_GET_CALLEE_FNDECL
-#define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl
-
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME java_mangle_decl
&& !DECL_UNINLINABLE (decl));
}
-/* Given a call_expr, try to figure out what its target might be. In
- the case of an indirection via the atable, search for the decl. If
- the decl is external, we return NULL. If we don't, the optimizer
- will replace the indirection with a direct call, which undoes the
- purpose of the atable indirection. */
-static tree
-java_get_callee_fndecl (const_tree call_expr)
-{
- tree method, table, element, atable_methods;
-
- HOST_WIDE_INT index;
-
- /* FIXME: This is disabled because we end up passing calls through
- the PLT, and we do NOT want to do that. */
- return NULL;
-
- if (TREE_CODE (call_expr) != CALL_EXPR)
- return NULL;
- method = CALL_EXPR_FN (call_expr);
- STRIP_NOPS (method);
- if (TREE_CODE (method) != ARRAY_REF)
- return NULL;
- table = TREE_OPERAND (method, 0);
- if (! DECL_LANG_SPECIFIC(table)
- || !DECL_OWNER (table)
- || TYPE_ATABLE_DECL (DECL_OWNER (table)) != table)
- return NULL;
-
- atable_methods = TYPE_ATABLE_METHODS (DECL_OWNER (table));
- index = TREE_INT_CST_LOW (TREE_OPERAND (method, 1));
-
- /* FIXME: Replace this for loop with a hash table lookup. */
- for (element = atable_methods; element; element = TREE_CHAIN (element))
- {
- if (index == 1)
- {
- tree purpose = TREE_PURPOSE (element);
- if (TREE_CODE (purpose) == FUNCTION_DECL
- && ! DECL_EXTERNAL (purpose))
- return purpose;
- else
- return NULL;
- }
- --index;
- }
-
- return NULL;
-}
-
-
static enum classify_record
java_classify_record (tree type)
{
#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
#define LANG_HOOKS_DWARF_NAME lhd_dwarf_name
-#define LANG_HOOKS_GET_CALLEE_FNDECL lhd_return_null_const_tree
#define LANG_HOOKS_EXPR_SIZE lhd_expr_size
#define LANG_HOOKS_TREE_SIZE lhd_tree_size
#define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p
LANG_HOOKS_DECL_PRINTABLE_NAME, \
LANG_HOOKS_DWARF_NAME, \
LANG_HOOKS_TYPES_COMPATIBLE_P, \
- LANG_HOOKS_GET_CALLEE_FNDECL, \
LANG_HOOKS_PRINT_ERROR_FUNCTION, \
LANG_HOOKS_EXPR_SIZE, \
LANG_HOOKS_TO_TARGET_CHARSET, \
in contexts where erroneously returning 0 causes problems. */
int (*types_compatible_p) (tree x, tree y);
- /* Given a CALL_EXPR, return a function decl that is its target. */
- tree (*lang_get_callee_fndecl) (const_tree);
-
/* Called by report_error_function to print out function name. */
void (*print_error_function) (struct diagnostic_context *, const char *,
struct diagnostic_info *);
+2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR objc/37460
+ * objc-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
+ * objc-act.h (objc_get_callee_fndecl): Remove prototype.
+ * objc-act.c (objc_get_callee_fndecl): Kill.
+
2008-09-17 Jan Hubicka <jh@suse.cz>
PR c++/18071
#endif
}
-/* Given a CALL expression, find the function being called. The ObjC
- version looks for the OBJ_TYPE_REF_EXPR which is used for objc_msgSend. */
-
-tree
-objc_get_callee_fndecl (const_tree call_expr)
-{
- tree addr = CALL_EXPR_FN (call_expr);
- if (TREE_CODE (addr) != OBJ_TYPE_REF)
- return 0;
-
- addr = OBJ_TYPE_REF_EXPR (addr);
-
- /* If the address is just `&f' for some function `f', then we know
- that `f' is being called. */
- if (TREE_CODE (addr) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL)
- return TREE_OPERAND (addr, 0);
-
- return 0;
-}
-
#include "gt-objc-objc-act.h"
bool objc_init (void);
const char *objc_printable_name (tree, int);
-tree objc_get_callee_fndecl (const_tree);
void objc_finish_file (void);
tree objc_fold_obj_type_ref (tree, tree);
enum gimplify_status objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
-#undef LANG_HOOKS_GET_CALLEE_FNDECL
-#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS objc_init_ts
+2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR objc/37460
+ * objcp-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
+
2008-04-03 Tom Tromey <tromey@redhat.com>
* Make-lang.in (obj-c++_OBJS): New variable.
#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
-#undef LANG_HOOKS_GET_CALLEE_FNDECL
-#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS objcxx_init_ts
&& TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL)
return TREE_OPERAND (addr, 0);
- /* We couldn't figure out what was being called. Maybe the front
- end has some idea. */
- return lang_hooks.lang_get_callee_fndecl (call);
+ /* We couldn't figure out what was being called. */
+ return NULL_TREE;
}
/* Print debugging information about tree nodes generated during the compile,