avoid redundant check on syntax errors.
* final.c (rest_of_handle_final): Call
targetm.asm_out.constructor/targetm.asm_out.destructor
* cgraphunit.c (cgraph_build_static_cdtor): Don't do it here; set
proper priority via decl_*_priority_insert.
* c-common.c (c_expand_body): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124044
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-04-22 Jan Hubicka <jh@suse.cz>
+
+ * final.c (rest_of_handle_final): Call
+ targetm.asm_out.constructor/targetm.asm_out.destructor
+ * cgraphunit.c (cgraph_build_static_cdtor): Don't do it here; set
+ proper priority via decl_*_priority_insert.
+ * c-common.c (c_expand_body): Likewise.
+
2007-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/29789
+2007-04-21 Jan Hubicka <jh@suse.cz>
+
+ * misc.c (gnat_expand_body): Don't call target for destructors,
+ avoid redundant check on syntax errors.
+
2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
* ada-tree.h (lang_tree_node): Use GENERIC_NEXT
static void
gnat_expand_body (tree gnu_decl)
{
- if (!DECL_INITIAL (gnu_decl) || DECL_INITIAL (gnu_decl) == error_mark_node)
- return;
-
tree_rest_of_compilation (gnu_decl);
-
- if (DECL_STATIC_CONSTRUCTOR (gnu_decl) && targetm.have_ctors_dtors)
- targetm.asm_out.constructor (XEXP (DECL_RTL (gnu_decl), 0),
- DEFAULT_INIT_PRIORITY);
-
- if (DECL_STATIC_DESTRUCTOR (gnu_decl) && targetm.have_ctors_dtors)
- targetm.asm_out.destructor (XEXP (DECL_RTL (gnu_decl), 0),
- DEFAULT_INIT_PRIORITY);
}
/* Adjusts the RLI used to layout a record after all the fields have been
void
c_expand_body (tree fndecl)
{
-
- if (!DECL_INITIAL (fndecl)
- || DECL_INITIAL (fndecl) == error_mark_node)
- return;
-
tree_rest_of_compilation (fndecl);
-
- if (DECL_STATIC_CONSTRUCTOR (fndecl)
- && targetm.have_ctors_dtors)
- targetm.asm_out.constructor (XEXP (DECL_RTL (fndecl), 0),
- decl_init_priority_lookup (fndecl));
- if (DECL_STATIC_DESTRUCTOR (fndecl)
- && targetm.have_ctors_dtors)
- targetm.asm_out.destructor (XEXP (DECL_RTL (fndecl), 0),
- decl_fini_priority_lookup (fndecl));
}
/* Hook used by staticp to handle language-specific tree codes. */
{
case 'I':
DECL_STATIC_CONSTRUCTOR (decl) = 1;
+ decl_init_priority_insert (decl, priority);
break;
case 'D':
DECL_STATIC_DESTRUCTOR (decl) = 1;
+ decl_fini_priority_insert (decl, priority);
break;
default:
gcc_unreachable ();
cgraph_add_new_function (decl, false);
cgraph_mark_needed_node (cgraph_node (decl));
-
- if (targetm.have_ctors_dtors)
- {
- void (*fn) (rtx, int);
-
- if (which == 'I')
- fn = targetm.asm_out.constructor;
- else
- fn = targetm.asm_out.destructor;
- fn (XEXP (DECL_RTL (decl), 0), priority);
- }
}
void
timevar_push (TV_SYMOUT);
(*debug_hooks->function_decl) (current_function_decl);
timevar_pop (TV_SYMOUT);
+ if (DECL_STATIC_CONSTRUCTOR (current_function_decl)
+ && targetm.have_ctors_dtors)
+ targetm.asm_out.constructor (XEXP (DECL_RTL (current_function_decl), 0),
+ decl_init_priority_lookup
+ (current_function_decl));
+ if (DECL_STATIC_DESTRUCTOR (current_function_decl)
+ && targetm.have_ctors_dtors)
+ targetm.asm_out.destructor (XEXP (DECL_RTL (current_function_decl), 0),
+ decl_fini_priority_lookup
+ (current_function_decl));
return 0;
}