Remove expand_body langhook

Jan Hubicka jh@suse.cz
Wed Sep 12 08:06:00 GMT 2007


> On Sun, 9 Sep 2007, Mark Mitchell wrote:
> 
> > Jan Hubicka wrote:
> >
> > > 	* decl.c (java_expand_body): Kill.
> > > 	(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
> >
> > OK.
> 
> Jan - I don't believe your patch was complete.  I'm getting a -Werror
> bootstrap failure in the treelang directory related to this patch.
> 
> 	gcc/treelang/treetree.c:1191: error: 'treelang_expand_function' defined but not used
> 	make[3]: *** [treelang/treetree.o] Error 1
> 
> This occurs because the langhook was removed but the underlying function
> called by the langhook was not.
> 
> treelang/treetree.c:static void treelang_expand_function (tree fndecl);
> treelang/treetree.c:#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
> treelang_expand_function treelang/treetree.c:treelang_expand_function(tree fndecl)
> 
> Also several instances of the LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION macro
> still remain.
> 
> ./c-objc-common.h:#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
> ./c-objc-common.h:#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
> fortran/f95-lang.c:#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
> treelang/treetree.c:#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
> treelang/treetree.c:#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION treelang_expand_function
> 
> Would you please clean these up?

I forgot to test treelang, sorry.  I am testing attached patch I will
commit as obvious

	* c-objc-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

	* f95-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

	* treetree.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
	(treelang_expand_function): Kill.
Index: c-objc-common.h
===================================================================
*** c-objc-common.h	(revision 128412)
--- c-objc-common.h	(working copy)
*************** extern void c_initialize_diagnostics (di
*** 88,96 ****
  #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
  #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree
  
- #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
- #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
- 
  #undef LANG_HOOKS_TYPE_FOR_MODE
  #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
  #undef LANG_HOOKS_TYPE_FOR_SIZE
--- 88,93 ----
Index: fortran/f95-lang.c
===================================================================
*** fortran/f95-lang.c	(revision 128412)
--- fortran/f95-lang.c	(working copy)
*************** static alias_set_type gfc_get_alias_set 
*** 111,117 ****
  #undef LANG_HOOKS_MARK_ADDRESSABLE
  #undef LANG_HOOKS_TYPE_FOR_MODE
  #undef LANG_HOOKS_TYPE_FOR_SIZE
- #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
  #undef LANG_HOOKS_CLEAR_BINDING_STACK
  #undef LANG_HOOKS_GET_ALIAS_SET
  #undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
--- 111,116 ----
Index: treelang/treetree.c
===================================================================
*** treelang/treetree.c	(revision 128412)
--- treelang/treetree.c	(working copy)
*************** static int global_bindings_p (void);
*** 141,147 ****
  static void insert_block (tree);
  
  static void tree_push_type_decl (tree id, tree type_node);
- static void treelang_expand_function (tree fndecl);
  
  /* The front end language hooks (addresses of code for this front
     end).  These are not really very language-dependent, i.e.
--- 141,146 ----
*************** static void treelang_expand_function (tr
*** 158,166 ****
  #undef LANG_HOOKS_ATTRIBUTE_TABLE
  #define LANG_HOOKS_ATTRIBUTE_TABLE treelang_attribute_table
  
- #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
- #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION treelang_expand_function
- 
  /* #undef LANG_HOOKS_TYPES_COMPATIBLE_P
  #define LANG_HOOKS_TYPES_COMPATIBLE_P hook_bool_tree_tree_true
  */
--- 157,162 ----
*************** const struct attribute_spec treelang_att
*** 1184,1197 ****
    { NULL, 0, 0, false, false, false, NULL },
  };
  
- /* Treelang expand function langhook.  */
- 
- static void
- treelang_expand_function (tree fndecl)
- {
-   /* We have nothing special to do while expanding functions for treelang.  */
-   tree_rest_of_compilation (fndecl);
- }
- 
  #include "debug.h" /* for debug_hooks, needed by gt-treelang-treetree.h */
  #include "gt-treelang-treetree.h"
--- 1180,1184 ----



More information about the Gcc-patches mailing list