+2006-08-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov.c (no_data_file): New flag.
+ (read_count_file): Set it if data file not present. Assume counts
+ zero if not found.
+ (output_lines): Don't name the data file, if there wasn't one.
+
2006-08-09 Eric Botcazou <ebotcazou@adacore.com>
* config/rs6000/rs6000.c (print_operand) <D>: Fix comment and adjust.
static char *da_file_name;
+/* Data file is missing. */
+
+static int no_data_file;
+
/* Output branch probabilities. */
static int flag_branches = 0;
if (!gcov_open (da_file_name, 1))
{
- fnotice (stderr, "%s:cannot open data file\n", da_file_name);
- return 1;
+ fnotice (stderr, "%s:cannot open data file, assuming not executed\n",
+ da_file_name);
+ no_data_file = 1;
+ return 0;
}
if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC))
{
fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name);
fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name);
- fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0, da_file_name);
+ fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0,
+ no_data_file ? "-" : da_file_name);
fprintf (gcov_file, "%9s:%5d:Runs:%u\n", "-", 0,
object_summary.ctrs[GCOV_COUNTER_ARCS].runs);
fprintf (gcov_file, "%9s:%5d:Programs:%u\n", "-", 0, program_count);