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/c-decl.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/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6c5056f..490d96c 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6776,24 +6776,20 @@ c_expand_body (fndecl, nested_p) if (DECL_STATIC_CONSTRUCTOR (fndecl)) { -#ifndef ASM_OUTPUT_CONSTRUCTOR - if (! flag_gnu_linker) - static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); + if (targetm.have_ctors_dtors) + (* targetm.asm_out.constructor) (XEXP (DECL_RTL (fndecl), 0), + DEFAULT_INIT_PRIORITY); else -#endif - assemble_constructor (XEXP (DECL_RTL (fndecl), 0), - DEFAULT_INIT_PRIORITY); + static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); } if (DECL_STATIC_DESTRUCTOR (fndecl)) { -#ifndef ASM_OUTPUT_DESTRUCTOR - if (! flag_gnu_linker) - static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); + if (targetm.have_ctors_dtors) + (* targetm.asm_out.destructor) (XEXP (DECL_RTL (fndecl), 0), + DEFAULT_INIT_PRIORITY); else -#endif - assemble_destructor (XEXP (DECL_RTL (fndecl), 0), - DEFAULT_INIT_PRIORITY); + static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); } if (nested_p) |