aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2005-03-21 12:31:10 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-03-21 12:31:10 +0000
commitf5d39c3d74dc91f2faf190114251226cc1f8b433 (patch)
treeb8c8216b7c4c768f8df9ca92f9ef59d19256a99a /gcc/gcov.c
parente1283056b23aa2cc1060abb74c5b42f102780b7b (diff)
downloadgcc-f5d39c3d74dc91f2faf190114251226cc1f8b433.zip
gcc-f5d39c3d74dc91f2faf190114251226cc1f8b433.tar.gz
gcc-f5d39c3d74dc91f2faf190114251226cc1f8b433.tar.bz2
re PR other/20564 (gcov default behaviour changed)
PR other/20564 * gcov.c (output_lines): Only output function block summary when outputting branch information. * doc/gcov.texi: Document format of preamble and additional block information lines. From-SVN: r96788
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index ee4d6b9..6675a06 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1774,7 +1774,7 @@ output_lines (FILE *gcov_file, const source_t *src)
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 = src->functions;
+ function_t *fn = NULL;
fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name);
fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name);
@@ -1803,6 +1803,9 @@ output_lines (FILE *gcov_file, const source_t *src)
}
}
+ if (flag_branches)
+ fn = src->functions;
+
for (line_num = 1, line = &src->lines[line_num];
line_num < src->num_lines; line_num++, line++)
{
@@ -1810,11 +1813,11 @@ output_lines (FILE *gcov_file, const source_t *src)
{
arc_t *arc = fn->blocks[fn->num_blocks - 1].pred;
gcov_type return_count = fn->blocks[fn->num_blocks - 1].count;
-
+
for (; arc; arc = arc->pred_next)
if (arc->fake)
return_count -= arc->count;
-
+
fprintf (gcov_file, "function %s", fn->name);
fprintf (gcov_file, " called %s",
format_gcov (fn->blocks[0].count, 0, -1));