aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-05-28 14:03:31 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2010-05-28 14:03:31 +0100
commit7ca92787862d1b6cae3fbda685c1ddf2009e73b3 (patch)
tree065aff3d1d01e48c7777eadaa47358832eb00cb5 /gcc/lto
parent8bf85f21b3a0180e286e2e32de3dd7f266729baf (diff)
downloadgcc-7ca92787862d1b6cae3fbda685c1ddf2009e73b3.zip
gcc-7ca92787862d1b6cae3fbda685c1ddf2009e73b3.tar.gz
gcc-7ca92787862d1b6cae3fbda685c1ddf2009e73b3.tar.bz2
final.c (rest_of_clean_state): Use %m in errors instead of strerror (errno).
* final.c (rest_of_clean_state): Use %m in errors instead of strerror (errno). * gengtype.c (read_input_list, close_output_files): Use xstrerror instead of strerror. * toplev.c (process_options): Use %m in errors instead of strerror (errno). * tree-dump.c (dump_begin): Use %m in errors instead of strerror (errno). fortran: * cpp.c (gfc_cpp_init_0): Use xstrerror instead of strerror. * module.c (write_char, gfc_dump_module, gfc_use_module): Use xstrerror instead of strerror. lto: * lto-coff.c (coff_errmsg): Remove. (lto_coff_begin_section_with_type, lto_obj_append_data): Use %m in errors instead of coff_errmsg (-1). * lto-macho.c (mach_o_errmsg): Remove. (lto_obj_begin_section, lto_obj_append_data): Use %m in errors instead of mach_o_errmsg (-1). * lto.c (read_cgraph_and_symbols): Use %m in errors instead of xstrerror (errno). From-SVN: r159969
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog11
-rw-r--r--gcc/lto/lto-coff.c15
-rw-r--r--gcc/lto/lto-macho.c13
-rw-r--r--gcc/lto/lto.c3
4 files changed, 17 insertions, 25 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index fb71dc3..fd70eff 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,14 @@
+2010-05-28 Joseph Myers <joseph@codesourcery.com>
+
+ * lto-coff.c (coff_errmsg): Remove.
+ (lto_coff_begin_section_with_type, lto_obj_append_data): Use %m in
+ errors instead of coff_errmsg (-1).
+ * lto-macho.c (mach_o_errmsg): Remove.
+ (lto_obj_begin_section, lto_obj_append_data): Use %m in errors
+ instead of mach_o_errmsg (-1).
+ * lto.c (read_cgraph_and_symbols): Use %m in errors instead of
+ xstrerror (errno).
+
2010-05-28 Richard Guenther <rguenther@suse.de>
* lto.c (prefix_name_with_star): Removed.
diff --git a/gcc/lto/lto-coff.c b/gcc/lto/lto-coff.c
index 1b87cbb..0eca893 100644
--- a/gcc/lto/lto-coff.c
+++ b/gcc/lto/lto-coff.c
@@ -1,5 +1,5 @@
/* LTO routines for COFF object files.
- Copyright 2009 Free Software Foundation, Inc.
+ Copyright 2009, 2010 Free Software Foundation, Inc.
Contributed by Dave Korn.
This file is part of GCC.
@@ -133,15 +133,6 @@ lto_file_init (lto_file *file, const char *filename, off_t offset)
file->offset = offset;
}
-/* Return an error string after an error, or a predetermined one
- if ERRCODE is not -1. */
-
-static const char *
-coff_errmsg (int errcode)
-{
- return strerror (errcode == -1 ? errno : errcode);
-}
-
/* Returns a hash code for P. */
static hashval_t
@@ -273,7 +264,7 @@ lto_coff_begin_section_with_type (const char *name, size_t type)
/* Create a new section. */
file->scn = coff_newsection (file, name, type);
if (!file->scn)
- fatal_error ("could not create a new COFF section: %s", coff_errmsg (-1));
+ fatal_error ("could not create a new COFF section: %m");
/* Add a string table entry and record the offset. */
gcc_assert (file->shstrtab_stream);
@@ -312,7 +303,7 @@ lto_obj_append_data (const void *data, size_t len, void *block)
coff_data = coff_newdata (file->scn);
if (!coff_data)
- fatal_error ("could not append data to COFF section: %s", coff_errmsg (-1));
+ fatal_error ("could not append data to COFF section: %m");
coff_data->d_buf = CONST_CAST (void *, data);
coff_data->d_size = len;
diff --git a/gcc/lto/lto-macho.c b/gcc/lto/lto-macho.c
index d5573a0..1ba74c0 100644
--- a/gcc/lto/lto-macho.c
+++ b/gcc/lto/lto-macho.c
@@ -140,15 +140,6 @@ lto_file_init (lto_file *file, const char *filename, off_t offset)
file->offset = offset;
}
-/* Return an error string after an error, or a predetermined one
- if ERRCODE is not -1. */
-
-static const char *
-mach_o_errmsg (int errcode)
-{
- return strerror (errcode == -1 ? errno : errcode);
-}
-
/* Returns a hash code for P. */
static hashval_t
@@ -321,7 +312,7 @@ lto_obj_begin_section (const char *name)
/* Create a new section. */
file->scn = mach_o_new_section (file, name);
if (!file->scn)
- fatal_error ("could not create a new Mach-O section: %s", mach_o_errmsg (-1));
+ fatal_error ("could not create a new Mach-O section: %m");
}
@@ -343,7 +334,7 @@ lto_obj_append_data (const void *data, size_t len, void *block)
mach_o_data = mach_o_new_data (file->scn);
if (!mach_o_data)
- fatal_error ("could not append data to Mach-O section: %s", mach_o_errmsg (-1));
+ fatal_error ("could not append data to Mach-O section: %m");
mach_o_data->d_buf = CONST_CAST (void *, data);
mach_o_data->d_size = len;
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 37d57bb..4ed6e20 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1481,8 +1481,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
resolution = fopen (resolution_file_name, "r");
if (resolution == NULL)
- fatal_error ("could not open symbol resolution file: %s",
- xstrerror (errno));
+ fatal_error ("could not open symbol resolution file: %m");
t = fscanf (resolution, "%u", &num_objects);
gcc_assert (t == 1);