diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-03-30 21:54:36 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-04-28 20:46:49 +0200 |
commit | 76cae6482e0e618d1f8709b3c5d14642378281c7 (patch) | |
tree | d930c6aa4a363a976021e495856603e4c0c21eb1 /libgcc | |
parent | f9b59dd8e5586862cd3c2fa53901ee2e90226a3c (diff) | |
download | gcc-76cae6482e0e618d1f8709b3c5d14642378281c7.zip gcc-76cae6482e0e618d1f8709b3c5d14642378281c7.tar.gz gcc-76cae6482e0e618d1f8709b3c5d14642378281c7.tar.bz2 |
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.
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/libgcov-util.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index ae5712c..906ea64 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; } |