re PR objc/37460 (NeXT runtime ICEs)

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  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.

From-SVN: r140430
This commit is contained in:
Andrew Pinski 2008-09-17 21:39:13 +00:00 committed by Andrew Pinski
parent 6847a7549c
commit 2700cb8675
12 changed files with 26 additions and 88 deletions

View file

@ -1,3 +1,10 @@
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

View file

@ -1,3 +1,8 @@
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

View file

@ -61,7 +61,6 @@ static int inline_init_test_initialization (void * *, void *);
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);
@ -156,9 +155,6 @@ struct language_function GTY(())
#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
@ -848,56 +844,6 @@ java_decl_ok_for_sibcall (const_tree 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)
{

View file

@ -105,7 +105,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#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
@ -255,7 +254,6 @@ extern tree lhd_make_node (enum tree_code);
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, \

View file

@ -354,9 +354,6 @@ struct lang_hooks
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 *);

View file

@ -1,3 +1,10 @@
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

View file

@ -9510,25 +9510,4 @@ objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
#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"

View file

@ -29,7 +29,6 @@ along with GCC; see the file COPYING3. If not see
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 *);

View file

@ -48,8 +48,6 @@ static void objc_init_ts (void);
#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

View file

@ -1,3 +1,8 @@
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.

View file

@ -48,8 +48,6 @@ static void objcxx_init_ts (void);
#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

View file

@ -6770,9 +6770,8 @@ get_callee_fndecl (const_tree call)
&& 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,