diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-21 12:31:10 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-21 12:31:10 +0000 |
commit | 7bcf25aaa9b79e64923f22c39b653f65e7d6b907 (patch) | |
tree | b8c8216b7c4c768f8df9ca92f9ef59d19256a99a /gcc/gcov.c | |
parent | 3c2a6130c0ca6d545cb6de0c8473b991de1eac69 (diff) | |
download | gcc-7bcf25aaa9b79e64923f22c39b653f65e7d6b907.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96788 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c index ee4d6b9aa80..6675a06b60e 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)); |