diff options
author | Richard Henderson <rth@redhat.com> | 2001-08-09 15:33:35 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-08-09 15:33:35 -0700 |
commit | 2cc07db4b089b8b3df05261f1d7acbc96d2e720a (patch) | |
tree | ddb2d5519f49bc33648c25225b8b8ba84df590b9 /gcc/cp/decl2.c | |
parent | ef8d8b8922a034dfac5cff9d5fa781dc57c49ed0 (diff) | |
download | gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.zip gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.tar.gz gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.tar.bz2 |
Move constructor/destructor handling into target hooks.
From-SVN: r44747
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a649e23..0a9e5ad 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2806,11 +2806,9 @@ start_objects (method_type, initp) NULL_TREE), NULL_TREE, SF_DEFAULT); -#if defined(ASM_OUTPUT_CONSTRUCTOR) && defined(ASM_OUTPUT_DESTRUCTOR) /* It can be a static function as long as collect2 does not have to scan the object file to find its ctor/dtor routine. */ - TREE_PUBLIC (current_function_decl) = 0; -#endif + TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors; /* Mark this declaration as used to avoid spurious warnings. */ TREE_USED (current_function_decl) = 1; @@ -2843,7 +2841,6 @@ finish_objects (method_type, initp, body) tree body; { tree fn; - rtx fnsym; /* Finish up. */ finish_compound_stmt (/*has_no_scope=*/0, body); @@ -2856,11 +2853,14 @@ finish_objects (method_type, initp, body) if (flag_syntax_only) return; - fnsym = XEXP (DECL_RTL (fn), 0); - if (method_type == 'I') - assemble_constructor (fnsym, initp); - else - assemble_destructor (fnsym, initp); + if (targetm.have_ctors_dtors) + { + rtx fnsym = XEXP (DECL_RTL (fn), 0); + if (method_type == 'I') + (* targetm.asm_out.constructor) (fnsym, initp); + else + (* targetm.asm_out.destructor) (fnsym, initp); + } } /* The names of the parameters to the function created to handle |