aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-08-09 15:33:35 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-08-09 15:33:35 -0700
commit2cc07db4b089b8b3df05261f1d7acbc96d2e720a (patch)
treeddb2d5519f49bc33648c25225b8b8ba84df590b9 /gcc/cp
parentef8d8b8922a034dfac5cff9d5fa781dc57c49ed0 (diff)
downloadgcc-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')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 50a96b6..02f3415 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-09 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (finish_objects): Use target hooks instead of
+ assemble_constructor and assemble_destructor.
+
2001-08-08 John David Anglin <dave@hiauly1.hia.nrc.ca>
* g++spec.c (lang_specific_driver): Quote argument after `-Xlinker'.
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