Commit 2043c38e by Nathan Sidwell Committed by Nathan Sidwell

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
parent 42127f51
2002-08-08 Nathan Sidwell <nathan@codesourcery.com>
* 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.
2002-08-09 Neil Booth <neil@daikokuya.co.uk> 2002-08-09 Neil Booth <neil@daikokuya.co.uk>
* Makefile.in (c-opts.o): Update * Makefile.in (c-opts.o): Update
......
...@@ -3320,7 +3320,7 @@ STAGE2_FLAGS_TO_PASS = \ ...@@ -3320,7 +3320,7 @@ STAGE2_FLAGS_TO_PASS = \
stage1_build: stage1_build:
$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \ $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \ CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
MAKEINFOFLAGS="$(MAKEINFOFLAGS)" MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
$(STAMP) stage1_build $(STAMP) stage1_build
echo stage1_build > stage_last echo stage1_build > stage_last
......
...@@ -890,7 +890,7 @@ opt) ...@@ -890,7 +890,7 @@ opt)
;; ;;
esac esac
else else
coverage_flags="-O2" coverage_flags=""
fi fi
......
...@@ -273,7 +273,7 @@ opt) ...@@ -273,7 +273,7 @@ opt)
AC_MSG_ERROR(unknown coverage setting $enableval) AC_MSG_ERROR(unknown coverage setting $enableval)
;; ;;
esac], esac],
[coverage_flags="-O2"]) [coverage_flags=""])
AC_SUBST(coverage_flags) AC_SUBST(coverage_flags)
AC_ARG_WITH(cpp_install_dir, AC_ARG_WITH(cpp_install_dir,
......
...@@ -127,6 +127,7 @@ static FILE *bbg_file; ...@@ -127,6 +127,7 @@ static FILE *bbg_file;
/* Name and file pointer of the input file for the arc count data. */ /* Name and file pointer of the input file for the arc count data. */
static FILE *da_file; static FILE *da_file;
static char *da_file_name;
/* Pointer of the output file for the basic block/line number map. */ /* Pointer of the output file for the basic block/line number map. */
static FILE *bb_file; static FILE *bb_file;
...@@ -1185,12 +1186,11 @@ void ...@@ -1185,12 +1186,11 @@ void
init_branch_prob (filename) init_branch_prob (filename)
const char *filename; const char *filename;
{ {
long len; int len = strlen (filename);
int i; int i;
if (flag_test_coverage) if (flag_test_coverage)
{ {
int len = strlen (filename);
char *data_file, *bbg_file_name; char *data_file, *bbg_file_name;
/* Open an output file for the basic block/line number map. */ /* Open an output file for the basic block/line number map. */
...@@ -1212,15 +1212,14 @@ init_branch_prob (filename) ...@@ -1212,15 +1212,14 @@ init_branch_prob (filename)
last_bb_file_name = 0; 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) if (flag_branch_probabilities)
{ {
char *da_file_name; da_file = fopen (da_file_name, "rb");
if (!da_file)
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)
warning ("file %s not found, execution counts assumed to be zero", warning ("file %s not found, execution counts assumed to be zero",
da_file_name); da_file_name);
} }
...@@ -1251,6 +1250,7 @@ end_branch_prob () ...@@ -1251,6 +1250,7 @@ end_branch_prob ()
{ {
fclose (bb_file); fclose (bb_file);
fclose (bbg_file); fclose (bbg_file);
unlink (da_file_name);
} }
if (flag_branch_probabilities && da_file) if (flag_branch_probabilities && da_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment