From 27283c7340100bf70de6af824143c052cc9d0c76 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 31 Mar 2003 15:18:24 +0000 Subject: gcov.c: Add -a & -u options. * gcov.c: Add -a & -u options. (struct arc_info): Add local_span, is_call_non_return, is_nonlocal_return, is_unconditional flags, remove is_call flag. (struct block_info): Add flags, is_call_site, is_nonlocal_return members. Make encodings a union with span member. (struct function_info): Add blocks_executed, line, src, line_next members. (struct coverage_info): Make branches a union with blocks member. (struct source_info): Add functions member. (object_summary, program_count): New global variables. (flag_all_blocks, flag_unconditional): New flags. (find_source, output_branch_count): New functions. (print_usage): Adjust. (options): Adjust. (process_args): Adjust. (read_graph_file) : Adjust. : Read flags. : Adjust. (read_count_file): Process SUMMARY tags. (solve_flow_graph): Set is_unconditional and clear is_call_site appropriately. (add_branch_counts): Adjust. Don't count unconditional branches. (add_line_counts): Deal with all-blocks mode, accumulate block coverage. (accumulate_line_counts): Adjust, generate local spanning tree for all-blocks mode. (output_lines): Adjust. * profile.c (branch_prob): Alter GCOV_FUNCTION_TAG record. * doc/gcov.texi: Document. testsuite: * lib/gcov.exp: Adjust call return testing strings. * g77.dg/gcov/gcov-1.f: Don't expect unconditional branches. From-SVN: r65090 --- gcc/profile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/profile.c') diff --git a/gcc/profile.c b/gcc/profile.c index 6631b5e..68435df 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -926,7 +926,7 @@ branch_prob () unsigned num_edges, ignored_edges; struct edge_list *el; const char *name = IDENTIFIER_POINTER - (DECL_ASSEMBLER_NAME (current_function_decl)); + (DECL_ASSEMBLER_NAME (current_function_decl)); profile_info.current_function_cfg_checksum = compute_checksum (); for (i = 0; i < profile_info.n_sections; i++) @@ -1086,6 +1086,8 @@ branch_prob () if (flag_test_coverage && bbg_file) { long offset; + const char *file = DECL_SOURCE_FILE (current_function_decl); + unsigned line = DECL_SOURCE_LINE (current_function_decl); /* Announce function */ if (gcov_write_unsigned (bbg_file, GCOV_TAG_FUNCTION) @@ -1094,6 +1096,8 @@ branch_prob () strlen (name)) || gcov_write_unsigned (bbg_file, profile_info.current_function_cfg_checksum) + || gcov_write_string (bbg_file, file, strlen (file)) + || gcov_write_unsigned (bbg_file, line) || gcov_write_length (bbg_file, offset)) goto bbg_error; -- cgit v1.1