diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2002-08-09 08:51:27 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-08-09 08:51:27 +0000 |
commit | 2043c38e8dcf438b3e3f86c6559feaab84d852ef (patch) | |
tree | d1c1eab856d0d9ef923bee055c80b85f71041bdc /gcc/profile.c | |
parent | 42127f51783a232f8fa376d079f8ea000eff6b44 (diff) | |
download | gcc-2043c38e8dcf438b3e3f86c6559feaab84d852ef.zip gcc-2043c38e8dcf438b3e3f86c6559feaab84d852ef.tar.gz gcc-2043c38e8dcf438b3e3f86c6559feaab84d852ef.tar.bz2 |
profile.c (da_file_name): New static var.
* profile.c (da_file_name): New static var.
(init_branch_prob): Initialize it.
(end_branch_prob): Remove da file.
* Makefile.in (stage1_build): Pass empty COVERAGE_FLAGS.
* configure.in (coverage_flags) default to nothing.
* configure: Rebuilt.
From-SVN: r56164
Diffstat (limited to 'gcc/profile.c')
-rw-r--r-- | gcc/profile.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/profile.c b/gcc/profile.c index 36ce8a3..528fc6f 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -127,6 +127,7 @@ static FILE *bbg_file; /* Name and file pointer of the input file for the arc count data. */ static FILE *da_file; +static char *da_file_name; /* Pointer of the output file for the basic block/line number map. */ static FILE *bb_file; @@ -1185,12 +1186,11 @@ void init_branch_prob (filename) const char *filename; { - long len; + int len = strlen (filename); int i; if (flag_test_coverage) { - int len = strlen (filename); char *data_file, *bbg_file_name; /* Open an output file for the basic block/line number map. */ @@ -1212,15 +1212,14 @@ init_branch_prob (filename) last_bb_file_name = 0; } + da_file_name = (char *) xmalloc (len + 4); + strcpy (da_file_name, filename); + strcat (da_file_name, ".da"); + if (flag_branch_probabilities) { - char *da_file_name; - - len = strlen (filename); - da_file_name = (char *) alloca (len + 4); - strcpy (da_file_name, filename); - strcat (da_file_name, ".da"); - if ((da_file = fopen (da_file_name, "rb")) == 0) + da_file = fopen (da_file_name, "rb"); + if (!da_file) warning ("file %s not found, execution counts assumed to be zero", da_file_name); } @@ -1251,6 +1250,7 @@ end_branch_prob () { fclose (bb_file); fclose (bbg_file); + unlink (da_file_name); } if (flag_branch_probabilities && da_file) |