gcov-tool: Allow merging of empty profile lists
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Wed, 23 Mar 2022 09:20:56 +0000 (10:20 +0100)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Thu, 28 Apr 2022 18:46:48 +0000 (20:46 +0200)
commit336ea18ad7f48d675fce8c97bf3b7a0ee3a5a450
tree37913244bca7c139f0d7d0196150a578cdd1d6dd
parent00c4405cd7f6a144d0a439e4d848d246920e6ff3
gcov-tool: Allow merging of empty profile lists

The gcov_profile_merge() already had code to deal with profile information
which had no counterpart to merge with.  For profile information from files
with no associated counterpart, the profile information is simply used as is
with the weighting transformation applied.  Make sure that gcov_profile_merge()
works with an empty target profile list.  Return the merged profile list.

gcc/
* gcov-tool.cc (gcov_profile_merge): Adjust return type.
(profile_merge): Allow merging of directories which contain no profile
files.

libgcc/
* libgcov-util.c (gcov_profile_merge): Return the list of merged
profiles.  Accept empty target and source profile lists.
gcc/gcov-tool.cc
libgcc/libgcov-util.c