+ if (arc->is_call_non_return)
+ {
+ if (arc->src->count)
+ {
+ fnotice (gcov_file, "call %2d returned %s\n", ix,
+ format_gcov (arc->src->count - arc->count,
+ arc->src->count, -flag_counts));
+ }
+ else
+ fnotice (gcov_file, "call %2d never executed\n", ix);
+ }
+ else if (!arc->is_unconditional)
+ {
+ if (arc->src->count)
+ fnotice (gcov_file, "branch %2d taken %s%s\n", ix,
+ format_gcov (arc->count, arc->src->count, -flag_counts),
+ arc->fall_through ? " (fallthrough)" : "");
+ else
+ fnotice (gcov_file, "branch %2d never executed\n", ix);
+ }
+ else if (flag_unconditional && !arc->dst->is_call_return)
+ {
+ if (arc->src->count)
+ fnotice (gcov_file, "unconditional %2d taken %s\n", ix,
+ format_gcov (arc->count, arc->src->count, -flag_counts));
+ else
+ fnotice (gcov_file, "unconditional %2d never executed\n", ix);
+ }
+ else
+ return 0;
+ return 1;
+
+}
+
+/* Read in the source file one line at a time, and output that line to
+ the gcov file preceded by its execution count and other
+ information. */
+
+static void
+output_lines (FILE *gcov_file, const source_t *src)
+{
+ FILE *source_file;
+ unsigned line_num; /* current line number. */
+ const line_t *line; /* current line info ptr. */
+ char string[STRING_SIZE]; /* line buffer. */
+ char const *retval = ""; /* status of source file reading. */
+ function_t *fn = NULL;
+
+ fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name);
+ if (!multiple_files)
+ {
+ fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_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);
+
+ source_file = fopen (src->name, "r");
+ if (!source_file)
+ {
+ fnotice (stderr, "%s:cannot open source file\n", src->name);
+ retval = NULL;
+ }
+ else if (src->file_time == 0)
+ fprintf (gcov_file, "%9s:%5d:Source is newer than graph\n", "-", 0);
+
+ if (flag_branches)
+ fn = src->functions;