From 23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05 Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 18 Nov 2020 16:13:23 +0100 Subject: gcov: Use system IO buffering gcc/ChangeLog: * gcov-io.c (gcov_write_block): Remove. (gcov_write_words): Likewise. (gcov_read_words): Re-implement using gcov_read_bytes. (gcov_allocate): Remove. (GCOV_BLOCK_SIZE): Likewise. (struct gcov_var): Remove most of the fields. (gcov_position): Implement with ftell. (gcov_rewrite): Remove setting of start and offset fields. (from_file): Re-format. (gcov_open): Remove setbuf call. It should not be needed. (gcov_close): Remove internal buffer handling. (gcov_magic): Use __builtin_bswap32. (gcov_write_counter): Use directly gcov_write_unsigned. (gcov_write_string): Use direct fwrite and do not round to 4 bytes. (gcov_seek): Use directly fseek. (gcov_write_tag): Use gcov_write_unsigned directly. (gcov_write_length): Likewise. (gcov_write_tag_length): Likewise. (gcov_read_bytes): Use directly fread. (gcov_read_unsigned): Use gcov_read_words. (gcov_read_counter): Likewise. (gcov_read_string): Use gcov_read_bytes. * gcov-io.h (GCOV_WORD_SIZE): Adjust to reflect that size is not in bytes, but words (4B). (GCOV_TAG_FUNCTION_LENGTH): Likewise. (GCOV_TAG_ARCS_LENGTH): Likewise. (GCOV_TAG_ARCS_NUM): Likewise. (GCOV_TAG_COUNTER_LENGTH): Likewise. (GCOV_TAG_COUNTER_NUM): Likewise. (GCOV_TAG_SUMMARY_LENGTH): Likewise. libgcc/ChangeLog: * libgcov-driver.c: Fix GNU coding style. --- libgcc/libgcov-driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index cbdf2ca..df7ccb2 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -558,10 +558,8 @@ read_fatal:; fn_buffer = free_fn_data (gi_ptr, fn_buffer, GCOV_COUNTERS); if ((error = gcov_close ())) - gcov_error (error < 0 ? - GCOV_PROF_PREFIX "Overflow writing\n" : - GCOV_PROF_PREFIX "Error writing\n", - gf->filename); + gcov_error ((error < 0 ? GCOV_PROF_PREFIX "Overflow writing\n" + : GCOV_PROF_PREFIX "Error writing\n"), gf->filename); } -- cgit v1.1