From 7ca50de02cf12c759f4f8daf60913704782b7d45 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 10 Dec 2019 21:18:23 -0500 Subject: hash-table.h: support non-zero empty values in empty_slow (v2) gcc/cp/ChangeLog: * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p): New static constant. * cp-tree.h (named_decl_hash::empty_zero_p): Likewise. (struct named_label_hash::empty_zero_p): Likewise. * decl2.c (mangled_decl_hash::empty_zero_p): Likewise. gcc/ChangeLog: * attribs.c (excl_hash_traits::empty_zero_p): New static constant. * gcov.c (function_start_pair_hash::empty_zero_p): Likewise. * graphite.c (struct sese_scev_hash::empty_zero_p): Likewise. * hash-map-tests.c (selftest::test_nonzero_empty_key): New selftest. (selftest::hash_map_tests_c_tests): Call it. * hash-map-traits.h (simple_hashmap_traits::empty_zero_p): New static constant, using the value of = H::empty_zero_p. (unbounded_hashmap_traits::empty_zero_p): Likewise, using the value from default_hash_traits . * hash-map.h (hash_map::empty_zero_p): Likewise, using the value from Traits. * hash-set-tests.c (value_hash_traits::empty_zero_p): Likewise. * hash-table.h (hash_table::alloc_entries): Guard the loop of calls to mark_empty with !Descriptor::empty_zero_p. (hash_table::empty_slow): Conditionalize the memset call with a check that Descriptor::empty_zero_p; otherwise, loop through the entries calling mark_empty on them. * hash-traits.h (int_hash::empty_zero_p): New static constant. (pointer_hash::empty_zero_p): Likewise. (pair_hash::empty_zero_p): Likewise. * ipa-devirt.c (default_hash_traits ::empty_zero_p): Likewise. * ipa-prop.c (ipa_bit_ggc_hash_traits::empty_zero_p): Likewise. (ipa_vr_ggc_hash_traits::empty_zero_p): Likewise. * profile.c (location_triplet_hash::empty_zero_p): Likewise. * sanopt.c (sanopt_tree_triplet_hash::empty_zero_p): Likewise. (sanopt_tree_couple_hash::empty_zero_p): Likewise. * tree-hasher.h (int_tree_hasher::empty_zero_p): Likewise. * tree-ssa-sccvn.c (vn_ssa_aux_hasher::empty_zero_p): Likewise. * tree-vect-slp.c (bst_traits::empty_zero_p): Likewise. * tree-vectorizer.h (default_hash_traits::empty_zero_p): Likewise. --- gcc/gcov.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/gcov.c') diff --git a/gcc/gcov.c b/gcc/gcov.c index 1dca304..a291bac 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1225,6 +1225,8 @@ struct function_start_pair_hash : typed_noop_remove ref.start_line = ~1U; } + static const bool empty_zero_p = false; + static void mark_empty (function_start &ref) { -- cgit v1.1 From ab37baa60ef287c0f5ba9eaa067aa3192b9fb37e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 17 Apr 2020 17:19:12 +0200 Subject: gcov: print total_lines summary for all files. gcc/ChangeLog: 2020-04-17 Martin Liska PR gcov-profile/94636 * gcov.c (main): Print total lines summary at the end. (generate_results): Expect file_name always being non-null. Print newline after intermediate file is printed in order to align with what we do for normal files. --- gcc/gcov.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'gcc/gcov.c') diff --git a/gcc/gcov.c b/gcc/gcov.c index a291bac..4888472 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -874,6 +874,9 @@ main (int argc, char **argv) } } + if (!flag_use_stdout) + executed_summary (total_lines, total_executed); + return 0; } @@ -1410,17 +1413,13 @@ generate_results (const char *file_name) } name_map needle; - - if (file_name) - { - needle.name = file_name; - vector::iterator it = std::find (names.begin (), names.end (), - needle); - if (it != names.end ()) - file_name = sources[it->src].coverage.name; - else - file_name = canonicalize_name (file_name); - } + needle.name = file_name; + vector::iterator it + = std::find (names.begin (), names.end (), needle); + if (it != names.end ()) + file_name = sources[it->src].coverage.name; + else + file_name = canonicalize_name (file_name); gcov_intermediate_filename = get_gcov_intermediate_filename (file_name); @@ -1462,7 +1461,11 @@ generate_results (const char *file_name) if (flag_gcov_file) { if (flag_json_format) - output_json_intermediate_file (json_files, src); + { + output_json_intermediate_file (json_files, src); + if (!flag_use_stdout) + fnotice (stdout, "\n"); + } else { if (flag_use_stdout) @@ -1509,9 +1512,6 @@ generate_results (const char *file_name) } } } - - if (!file_name) - executed_summary (total_lines, total_executed); } /* Release all memory used. */ -- cgit v1.1