public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: gcc-patches@gcc.gnu.org
Subject: [RFC/gcov 04/12] gcov: Make gcov_seek() static
Date: Thu, 31 Mar 2022 13:35:07 +0200	[thread overview]
Message-ID: <20220331113515.35764-5-sebastian.huber@embedded-brains.de> (raw)
In-Reply-To: <20220331113515.35764-1-sebastian.huber@embedded-brains.de>

This function is only used by gcov_write_length() in the gcov-io.cc file.

gcc/

	* gcov-io.cc (gcov_seek): Make it static.
	* gcov-io.h (struct gcov_summary): Do not mention gcov_seek().

libgcc/

	* libgcov.h (gcov_seek): Remove define and declaration.
---
 gcc/gcov-io.cc   | 4 +---
 gcc/gcov-io.h    | 6 +++---
 libgcc/libgcov.h | 2 --
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/gcc/gcov-io.cc b/gcc/gcov-io.cc
index 017a6e32a5d..fee3130f94a 100644
--- a/gcc/gcov-io.cc
+++ b/gcc/gcov-io.cc
@@ -294,17 +294,15 @@ gcov_write_filename (const char *filename)
 
   gcov_write_string (filename);
 }
-#endif
 
 /* Move to a given position in a gcov file.  */
 
-GCOV_LINKAGE void
+static void
 gcov_seek (gcov_position_t base)
 {
   fseek (gcov_var.file, base, SEEK_SET);
 }
 
-#if !IN_LIBGCOV
 /* Write a tag TAG and reserve space for the record length. Return a
    value to be used for gcov_write_length.  */
 
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index afe74b002f1..204ae0ccf7f 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -340,9 +340,9 @@ struct gcov_summary
 /* Functions for reading and writing gcov files. In libgcov you can
    open the file for reading then writing. Elsewhere you can open the
    file either for reading or for writing. When reading a file you may
-   use the gcov_read_* functions, gcov_sync, gcov_position, &
-   gcov_error. When writing a file you may use the gcov_write
-   functions, gcov_seek & gcov_error. When a file is to be rewritten
+   use the gcov_read_* functions, gcov_sync, gcov_position, and
+   gcov_error. When writing a file you may use the gcov_write*
+   functions and gcov_error. When a file is to be rewritten
    you use the functions for reading, then gcov_rewrite then the
    functions for writing.  Your file may become corrupted if you break
    these invariants.  */
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index f190547e819..487bd1464cd 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -115,7 +115,6 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (QI)));
 #define gcov_open __gcov_open
 #define gcov_close __gcov_close
 #define gcov_position __gcov_position
-#define gcov_seek __gcov_seek
 #define gcov_rewrite __gcov_rewrite
 #define gcov_is_error __gcov_is_error
 #define gcov_write_unsigned __gcov_write_unsigned
@@ -346,7 +345,6 @@ extern int __gcov_execve (const char *, char  *const [], char *const [])
 GCOV_LINKAGE void gcov_write_summary (gcov_unsigned_t /*tag*/,
                                       const struct gcov_summary *)
     ATTRIBUTE_HIDDEN;
-GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN;
 GCOV_LINKAGE void gcov_rewrite (void) ATTRIBUTE_HIDDEN;
 
 /* "Counts" stored in gcda files can be a real counter value, or
-- 
2.34.1


  parent reply	other threads:[~2022-03-31 11:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 11:35 [RFC/gcov 00/12] Add merge-stream subcommand to gcov-tool Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 01/12] gcov-tool: Allow merging of empty profile lists Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 02/12] gcov: Add mode to all gcov_open() Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 03/12] gcov: Add open mode parameter to gcov_do_dump() Sebastian Huber
2022-03-31 11:35 ` Sebastian Huber [this message]
2022-03-31 11:35 ` [RFC/gcov 05/12] gcov: Add __gcov_filename_to_gcfn() Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 06/12] gcov-tool: Support file input from stdin Sebastian Huber
2022-04-07  8:32   ` Martin Liška
2022-03-31 11:35 ` [RFC/gcov 07/12] gcov: Use xstrdup() Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 08/12] gcov: Move prepend to list to read_gcda_file() Sebastian Huber
2022-04-07  8:33   ` Martin Liška
2022-03-31 11:35 ` [RFC/gcov 09/12] gcov: Move gcov_open() to caller of read_gcda_file() Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 10/12] gcov: Fix integer types in ftw_read_file() Sebastian Huber
2022-03-31 11:35 ` [RFC/gcov 11/12] gcov: Record EOF error during read Sebastian Huber
2022-04-07  8:34   ` Martin Liška
2022-03-31 11:35 ` [RFC/gcov 12/12] gcov-tool: Add merge-stream subcommand Sebastian Huber
2022-04-07  8:36   ` Martin Liška
2022-04-07  8:38 ` [RFC/gcov 00/12] Add merge-stream subcommand to gcov-tool Martin Liška
2022-04-07  9:05   ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331113515.35764-5-sebastian.huber@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).