* libgcc2.c (__bb_exit_func): Kill -ax dumping code.

From-SVN: r48159
This commit is contained in:
Jan Hubicka 2001-12-18 16:38:40 +01:00 committed by Jan Hubicka
parent b1bf2706e8
commit 114e78f8f0
2 changed files with 110 additions and 235 deletions

View File

@ -1,3 +1,7 @@
Tue Dec 18 16:37:42 CET 2001 Jan Hubicka <jh@suse.cz>
* libgcc2.c (__bb_exit_func): Kill -ax dumping code.
2001-12-18 Jason Merrill <jason@redhat.com>
C++ ABI change: destroy value arguments in caller.

View File

@ -1332,21 +1332,16 @@ static int num_digits (long long value, int base) __attribute__ ((const));
void
__bb_exit_func (void)
{
FILE *da_file, *file;
FILE *da_file;
long time_value;
int i;
struct bb *ptr;
if (bb_head == 0)
return;
i = strlen (bb_head->filename) - 3;
if (!strcmp (bb_head->filename+i, ".da"))
{
/* Must be -fprofile-arcs not -a.
Dump data in a form that gcov expects. */
struct bb *ptr;
for (ptr = bb_head; ptr != (struct bb *) 0; ptr = ptr->next)
{
@ -1425,7 +1420,8 @@ __bb_exit_func (void)
if (__read_gcov_type (&v, da_file, 8) != 0)
{
fprintf (stderr, "arc profiling: Can't read output file %s.\n",
fprintf (stderr,
"arc profiling: Can't read output file %s.\n",
ptr->filename);
break;
}
@ -1478,131 +1474,6 @@ __bb_exit_func (void)
return;
}
/* Must be basic block profiling. Emit a human readable output file. */
file = fopen ("bb.out", "a");
if (!file)
perror ("bb.out");
else
{
struct bb *ptr;
/* This is somewhat type incorrect, but it avoids worrying about
exactly where time.h is included from. It should be ok unless
a void * differs from other pointer formats, or if sizeof (long)
is < sizeof (time_t). It would be nice if we could assume the
use of rationale standards here. */
time ((void *) &time_value);
fprintf (file, "Basic block profiling finished on %s\n",
ctime ((void *) &time_value));
/* We check the length field explicitly in order to allow compatibility
with older GCC's which did not provide it. */
for (ptr = bb_head; ptr != (struct bb *) 0; ptr = ptr->next)
{
int i;
int func_p = (ptr->nwords >= (long) sizeof (struct bb)
&& ptr->nwords <= 1000
&& ptr->functions);
int line_p = (func_p && ptr->line_nums);
int file_p = (func_p && ptr->filenames);
int addr_p = (ptr->addresses != 0);
long ncounts = ptr->ncounts;
gcov_type cnt_max = 0;
long line_max = 0;
long addr_max = 0;
int file_len = 0;
int func_len = 0;
int blk_len = num_digits (ncounts, 10);
int cnt_len;
int line_len;
int addr_len;
fprintf (file, "File %s, %ld basic blocks \n\n",
ptr->filename, ncounts);
/* Get max values for each field. */
for (i = 0; i < ncounts; i++)
{
const char *p;
int len;
if (cnt_max < ptr->counts[i])
cnt_max = ptr->counts[i];
if (addr_p && (unsigned long) addr_max < ptr->addresses[i])
addr_max = ptr->addresses[i];
if (line_p && line_max < ptr->line_nums[i])
line_max = ptr->line_nums[i];
if (func_p)
{
p = (ptr->functions[i]) ? (ptr->functions[i]) : "<none>";
len = strlen (p);
if (func_len < len)
func_len = len;
}
if (file_p)
{
p = (ptr->filenames[i]) ? (ptr->filenames[i]) : "<none>";
len = strlen (p);
if (file_len < len)
file_len = len;
}
}
addr_len = num_digits (addr_max, 16);
cnt_len = num_digits (cnt_max, 10);
line_len = num_digits (line_max, 10);
/* Now print out the basic block information. */
for (i = 0; i < ncounts; i++)
{
#if LONG_TYPE_SIZE == GCOV_TYPE_SIZE
fprintf (file,
" Block #%*d: executed %*ld time(s)",
blk_len, i+1,
cnt_len, ptr->counts[i]);
#else
fprintf (file,
" Block #%*d: executed %*lld time(s)",
blk_len, i+1,
cnt_len, ptr->counts[i]);
#endif
if (addr_p)
fprintf (file, " address= 0x%.*lx", addr_len,
ptr->addresses[i]);
if (func_p)
fprintf (file, " function= %-*s", func_len,
(ptr->functions[i]) ? ptr->functions[i] : "<none>");
if (line_p)
fprintf (file, " line= %*ld", line_len, ptr->line_nums[i]);
if (file_p)
fprintf (file, " file= %s",
(ptr->filenames[i]) ? ptr->filenames[i] : "<none>");
fprintf (file, "\n");
}
fprintf (file, "\n");
fflush (file);
}
fprintf (file, "\n\n");
fclose (file);
}
}
void
__bb_init_func (struct bb *blocks)
{