summaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-09 22:33:35 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-09 22:33:35 +0000
commit01d15dc570c9d303e03ad64a0f66a38f5ce4b8bd (patch)
treeddb2d5519f49bc33648c25225b8b8ba84df590b9 /gcc/profile.c
parentbe6b7965bba925cee48dfe2af6c9a40e85c744c1 (diff)
downloadgcc-01d15dc570c9d303e03ad64a0f66a38f5ce4b8bd.tar.gz
Move constructor/destructor handling into target hooks.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44747 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index 983df4330a7..dbde8923f78 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);
}