summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-22 15:33:32 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-22 15:33:32 +0000
commit64c2e9b0501e177907c02b329c3e6e811bfa4fec (patch)
tree7a5b02a557aae27620a13c42bc29913de6d67d9e /gcc/final.c
parentb42bbd03ae97700071478c966c66b1e2fc1b8ae8 (diff)
downloadgcc-64c2e9b0501e177907c02b329c3e6e811bfa4fec.tar.gz
* ada/misc.c (gnat_expand_body): Don't call target for destructors,
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
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c
index a18f0299d4a..ebc1efe4509 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4043,6 +4043,16 @@ rest_of_handle_final (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;
}