summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/final.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-18 06:47:49 +0000
committerpeter <peter@FreeBSD.org>1996-09-18 06:47:49 +0000
commite1223082127bb2b1757f5524cec85a0fe6c026f5 (patch)
tree34e430a0d9c00af31ffce369ba5242c4eec53b05 /contrib/gcc/final.c
parent30f62fbc36b35af55fe44890f18e888d5562b300 (diff)
downloadFreeBSD-src-e1223082127bb2b1757f5524cec85a0fe6c026f5.zip
FreeBSD-src-e1223082127bb2b1757f5524cec85a0fe6c026f5.tar.gz
Add the hooks that we use for our profiling extensions.
Obtained from: bde
Diffstat (limited to 'contrib/gcc/final.c')
-rw-r--r--contrib/gcc/final.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/gcc/final.c b/contrib/gcc/final.c
index 481782e..b53914f 100644
--- a/contrib/gcc/final.c
+++ b/contrib/gcc/final.c
@@ -341,6 +341,8 @@ end_final (filename)
ASM_OUTPUT_ALIGN (asm_out_file, align);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 0);
/* zero word */
assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
@@ -914,6 +916,9 @@ final_start_function (first, file, optimize)
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -971,14 +976,18 @@ static void
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, POINTER_SIZE);
+#endif /* not NO_PROFILE_DATA */
int sval = current_function_returns_struct;
int cxt = current_function_needs_context;
+#ifndef NO_PROFILE_DATA
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
text_section ();
@@ -1066,6 +1075,9 @@ final_end_function (first, file, optimize)
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
sdbout_end_epilogue ();
OpenPOWER on IntegriCloud