public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-15] gcov: Move prepend to list to read_gcda_file()
@ 2022-04-28 19:41 Sebastian Huber
0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2022-04-28 19:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:76cae6482e0e618d1f8709b3c5d14642378281c7
commit r13-15-g76cae6482e0e618d1f8709b3c5d14642378281c7
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Wed Mar 30 21:54:36 2022 +0200
gcov: Move prepend to list to read_gcda_file()
This helps to reuse read_gcda_file().
libgcc/
* libgcov-util.c (read_gcda_file): Prepend new info object to global
list.
(ftw_read_file): Remove list append here.
Diff:
---
libgcc/libgcov-util.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c
index ae5712c0138..906ea645547 100644
--- a/libgcc/libgcov-util.c
+++ b/libgcc/libgcov-util.c
@@ -301,6 +301,9 @@ read_gcda_file (const char *filename)
num_fn_info = 0;
curr_fn_info = 0;
+ /* Prepend to global gcov info list. */
+ obj_info->next = gcov_info_head;
+ gcov_info_head = obj_info;
/* Read stamp. */
obj_info->stamp = gcov_read_unsigned ();
@@ -392,7 +395,6 @@ ftw_read_file (const char *filename,
{
int filename_len;
int suffix_len;
- struct gcov_info *obj_info;
/* Only read regular files. */
if (type != FTW_F)
@@ -410,12 +412,7 @@ ftw_read_file (const char *filename,
if (verbose)
fnotice (stderr, "reading file: %s\n", filename);
- obj_info = read_gcda_file (xstrdup (filename));
- if (!obj_info)
- return 0;
-
- obj_info->next = gcov_info_head;
- gcov_info_head = obj_info;
+ (void)read_gcda_file (xstrdup (filename));
return 0;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-28 19:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 19:41 [gcc r13-15] gcov: Move prepend to list to read_gcda_file() Sebastian Huber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).