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/profile.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/profile.c')
-rw-r--r-- | gcc/profile.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/profile.c b/gcc/profile.c index 983df43..dbde892 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */ #include "hard-reg-set.h" #include "basic-block.h" #include "gcov-io.h" +#include "target.h" /* Additional information about the edges we need. */ struct edge_info @@ -1122,13 +1123,11 @@ output_func_start_profiler () build_function_type (void_type_node, NULL_TREE)); DECL_EXTERNAL (fndecl) = 0; -#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 (fndecl) = 0; -#else - TREE_PUBLIC (fndecl) = 1; -#endif + TREE_PUBLIC (fndecl) = ! targetm.have_ctors_dtors; + + TREE_USED (fndecl) = 1; DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); @@ -1176,5 +1175,7 @@ output_func_start_profiler () fflush (asm_out_file); current_function_decl = NULL_TREE; - assemble_constructor (XEXP (DECL_RTL (fndecl), 0), DEFAULT_INIT_PRIORITY); + if (targetm.have_ctors_dtors) + (* targetm.asm_out.constructor) (XEXP (DECL_RTL (fndecl), 0), + DEFAULT_INIT_PRIORITY); } |