diff mbox series

Reset more langhooks at free lang data

Message ID 20181105210449.mcyelb6wstupdqj2@kam.mff.cuni.cz
State New
Headers show
Series Reset more langhooks at free lang data | expand

Commit Message

Jan Hubicka Nov. 5, 2018, 9:04 p.m. UTC
Hi,
this patch reset some of frontend langhooks that I think should be
completely handled by middle-end now.  I will also make patch to rewrite
set_assembler_name in some way that is safe, the comment bellow
the hunk added is bit oversimplified because we do add external
symbols (such as ctors and dtors or profile stuff).

The patch fixed the ICE in var_mod_type_p with obj-c++.  The other
hooks was changed more as a pre-cauntion. We want to detach FE
as much as possible from middle-end.

lto-Bootstrapped/regtested x86_64-linux, OK?

Honza

	* tree.c (free_lang_data): Reset overwite_assembler_name,
	print_xnode, print_decl, print_type and print_identifier of
	langhooks.

Comments

Richard Biener Nov. 6, 2018, 8:02 a.m. UTC | #1
On Mon, 5 Nov 2018, Jan Hubicka wrote:

> Hi,
> this patch reset some of frontend langhooks that I think should be
> completely handled by middle-end now.  I will also make patch to rewrite
> set_assembler_name in some way that is safe, the comment bellow
> the hunk added is bit oversimplified because we do add external
> symbols (such as ctors and dtors or profile stuff).
> 
> The patch fixed the ICE in var_mod_type_p with obj-c++.  The other
> hooks was changed more as a pre-cauntion. We want to detach FE
> as much as possible from middle-end.
> 
> lto-Bootstrapped/regtested x86_64-linux, OK?

OK.

I wonder if we can do some of this resetting unconditionally.

Richard.

> Honza
> 
> 	* tree.c (free_lang_data): Reset overwite_assembler_name,
> 	print_xnode, print_decl, print_type and print_identifier of
> 	langhooks.
> Index: tree.c
> ===================================================================
> --- tree.c	(revision 265807)
> +++ tree.c	(working copy)
> @@ -6010,6 +6016,13 @@ free_lang_data (void)
>    lang_hooks.dwarf_name = lhd_dwarf_name;
>    lang_hooks.decl_printable_name = gimple_decl_printable_name;
>    lang_hooks.gimplify_expr = lhd_gimplify_expr;
> +  lang_hooks.overwrite_decl_assembler_name = lhd_overwrite_decl_assembler_name;
> +  lang_hooks.print_xnode = lhd_print_tree_nothing;
> +  lang_hooks.print_decl = lhd_print_tree_nothing;
> +  lang_hooks.print_type = lhd_print_tree_nothing;
> +  lang_hooks.print_identifier = lhd_print_tree_nothing;
> +
> +  lang_hooks.tree_inlining.var_mod_type_p = hook_bool_tree_tree_false;
>  
>    /* We do not want the default decl_assembler_name implementation,
>       rather if we have fixed everything we want a wrapper around it
> 
>
diff mbox series

Patch

Index: tree.c
===================================================================
--- tree.c	(revision 265807)
+++ tree.c	(working copy)
@@ -6010,6 +6016,13 @@  free_lang_data (void)
   lang_hooks.dwarf_name = lhd_dwarf_name;
   lang_hooks.decl_printable_name = gimple_decl_printable_name;
   lang_hooks.gimplify_expr = lhd_gimplify_expr;
+  lang_hooks.overwrite_decl_assembler_name = lhd_overwrite_decl_assembler_name;
+  lang_hooks.print_xnode = lhd_print_tree_nothing;
+  lang_hooks.print_decl = lhd_print_tree_nothing;
+  lang_hooks.print_type = lhd_print_tree_nothing;
+  lang_hooks.print_identifier = lhd_print_tree_nothing;
+
+  lang_hooks.tree_inlining.var_mod_type_p = hook_bool_tree_tree_false;
 
   /* We do not want the default decl_assembler_name implementation,
      rather if we have fixed everything we want a wrapper around it