OSDN Git Service

2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2008 21:39:13 +0000 (21:39 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2008 21:39:13 +0000 (21:39 +0000)
        * 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

12 files changed:
gcc/ChangeLog
gcc/java/ChangeLog
gcc/java/lang.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/objc/objc-act.h
gcc/objc/objc-lang.c
gcc/objcp/ChangeLog
gcc/objcp/objcp-lang.c
gcc/tree.c

index 67c3c80..468c604 100644 (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
index c5a9ecf..e7b6263 100644 (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
index af2ed80..2a962c0 100644 (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)
 {
index 37b5905..996e2f2 100644 (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, \
index 2d62f99..752ad99 100644 (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 *);
index 1457f7f..039ad3b 100644 (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
index 1fd52f0..837f3cf 100644 (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"
index 741401d..6c6b227 100644 (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 *);
index 11ba6ac..37c785c 100644 (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
 
index e8bf0d6..b296480 100644 (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.
index d595ba2..ab3206a 100644 (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
 
index ab14286..3d2f3e1 100644 (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,