Commit 2cee0101 by Dave Korn Committed by Dave Korn

lto.h (lto_elf_file_open): Rename prototype from this ...

	* lto.h (lto_elf_file_open): Rename prototype from this ...
	(lto_obj_file_open): ... to this.
	(lto_elf_file_close): Likewise ...
	(lto_obj_file_close): ... and likewise.
	(lto_elf_build_section_table): Likewise ...
	(lto_obj_build_section_table): ... and likewise.
	(lto_elf_begin_section): Likewise ...
	(lto_obj_begin_section): ... and likewise.
	(lto_elf_append_data): Likewise ...
	(lto_obj_append_data): ... and likewise.
	(lto_elf_end_section): Likewise ...
	(lto_obj_end_section): ... and likewise.
	* lto.c (lto_file_read): Update references to the above.
	(lto_wpa_write_files): Likewise.
	(lto_read_all_file_options): Likewise.
	(read_cgraph_and_symbols): Likewise.
	* lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
	(LANG_HOOKS_APPEND_DATA): Likewise.
	(LANG_HOOKS_END_SECTION): Likewise.
	* lto-elf.c (lto_elf_file_open): Rename from this ...
	(lto_obj_file_open): ... to this, updating any references.
	(lto_elf_file_close): Likewise ...
	(lto_obj_file_close): ... and likewise.
	(lto_elf_build_section_table): Likewise ...
	(lto_obj_build_section_table): ... and likewise.
	(lto_elf_begin_section): Likewise ...
	(lto_obj_begin_section): ... and likewise.
	(lto_elf_append_data): Likewise ...
	(lto_obj_append_data): ... and likewise.
	(lto_elf_end_section): Likewise ...
	(lto_obj_end_section): ... and likewise.

From-SVN: r158718
parent b2358c06
2010-04-26 Dave Korn <dave.korn.cygwin@gmail.com>
* lto.h (lto_elf_file_open): Rename prototype from this ...
(lto_obj_file_open): ... to this.
(lto_elf_file_close): Likewise ...
(lto_obj_file_close): ... and likewise.
(lto_elf_build_section_table): Likewise ...
(lto_obj_build_section_table): ... and likewise.
(lto_elf_begin_section): Likewise ...
(lto_obj_begin_section): ... and likewise.
(lto_elf_append_data): Likewise ...
(lto_obj_append_data): ... and likewise.
(lto_elf_end_section): Likewise ...
(lto_obj_end_section): ... and likewise.
* lto.c (lto_file_read): Update references to the above.
(lto_wpa_write_files): Likewise.
(lto_read_all_file_options): Likewise.
(read_cgraph_and_symbols): Likewise.
* lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
(LANG_HOOKS_APPEND_DATA): Likewise.
(LANG_HOOKS_END_SECTION): Likewise.
* lto-elf.c (lto_elf_file_open): Rename from this ...
(lto_obj_file_open): ... to this, updating any references.
(lto_elf_file_close): Likewise ...
(lto_obj_file_close): ... and likewise.
(lto_elf_build_section_table): Likewise ...
(lto_obj_build_section_table): ... and likewise.
(lto_elf_begin_section): Likewise ...
(lto_obj_begin_section): ... and likewise.
(lto_elf_append_data): Likewise ...
(lto_obj_append_data): ... and likewise.
(lto_elf_end_section): Likewise ...
(lto_obj_end_section): ... and likewise.
2010-04-21 Jan Hubicka <jh@suse.cz> 2010-04-21 Jan Hubicka <jh@suse.cz>
* lto.c (lto_fixup_tree): Do not call wpa fixup. * lto.c (lto_fixup_tree): Do not call wpa fixup.
......
...@@ -179,7 +179,7 @@ eq_name (const void *p1, const void *p2) ...@@ -179,7 +179,7 @@ eq_name (const void *p1, const void *p2)
the start and size of each section in the .o file. */ the start and size of each section in the .o file. */
htab_t htab_t
lto_elf_build_section_table (lto_file *lto_file) lto_obj_build_section_table (lto_file *lto_file)
{ {
lto_elf_file *elf_file = (lto_elf_file *)lto_file; lto_elf_file *elf_file = (lto_elf_file *)lto_file;
htab_t section_hash_table; htab_t section_hash_table;
...@@ -322,7 +322,7 @@ lto_elf_begin_section_with_type (const char *name, size_t type) ...@@ -322,7 +322,7 @@ lto_elf_begin_section_with_type (const char *name, size_t type)
/* Begin a new ELF section named NAME in the current output file. */ /* Begin a new ELF section named NAME in the current output file. */
void void
lto_elf_begin_section (const char *name) lto_obj_begin_section (const char *name)
{ {
lto_elf_begin_section_with_type (name, SHT_PROGBITS); lto_elf_begin_section_with_type (name, SHT_PROGBITS);
} }
...@@ -333,7 +333,7 @@ lto_elf_begin_section (const char *name) ...@@ -333,7 +333,7 @@ lto_elf_begin_section (const char *name)
been written. */ been written. */
void void
lto_elf_append_data (const void *data, size_t len, void *block) lto_obj_append_data (const void *data, size_t len, void *block)
{ {
lto_elf_file *file; lto_elf_file *file;
Elf_Data *elf_data; Elf_Data *elf_data;
...@@ -370,7 +370,7 @@ lto_elf_append_data (const void *data, size_t len, void *block) ...@@ -370,7 +370,7 @@ lto_elf_append_data (const void *data, size_t len, void *block)
and sets the current output file's scn member to NULL. */ and sets the current output file's scn member to NULL. */
void void
lto_elf_end_section (void) lto_obj_end_section (void)
{ {
lto_elf_file *file; lto_elf_file *file;
...@@ -604,7 +604,7 @@ init_ehdr (lto_elf_file *elf_file) ...@@ -604,7 +604,7 @@ init_ehdr (lto_elf_file *elf_file)
Returns the opened file. */ Returns the opened file. */
lto_file * lto_file *
lto_elf_file_open (const char *filename, bool writable) lto_obj_file_open (const char *filename, bool writable)
{ {
lto_elf_file *elf_file; lto_elf_file *elf_file;
lto_file *result = NULL; lto_file *result = NULL;
...@@ -704,7 +704,7 @@ lto_elf_file_open (const char *filename, bool writable) ...@@ -704,7 +704,7 @@ lto_elf_file_open (const char *filename, bool writable)
fail: fail:
if (result) if (result)
lto_elf_file_close (result); lto_obj_file_close (result);
return NULL; return NULL;
} }
...@@ -714,7 +714,7 @@ lto_elf_file_open (const char *filename, bool writable) ...@@ -714,7 +714,7 @@ lto_elf_file_open (const char *filename, bool writable)
any cached data buffers are freed. */ any cached data buffers are freed. */
void void
lto_elf_file_close (lto_file *file) lto_obj_file_close (lto_file *file)
{ {
lto_elf_file *elf_file = (lto_elf_file *) file; lto_elf_file *elf_file = (lto_elf_file *) file;
struct lto_char_ptr_base *cur, *tmp; struct lto_char_ptr_base *cur, *tmp;
...@@ -750,7 +750,7 @@ lto_elf_file_close (lto_file *file) ...@@ -750,7 +750,7 @@ lto_elf_file_close (lto_file *file)
if (gelf_update_ehdr (elf_file->elf, ehdr_p) == 0) if (gelf_update_ehdr (elf_file->elf, ehdr_p) == 0)
fatal_error ("gelf_update_ehdr() failed: %s", elf_errmsg (-1)); fatal_error ("gelf_update_ehdr() failed: %s", elf_errmsg (-1));
lto_write_stream (elf_file->shstrtab_stream); lto_write_stream (elf_file->shstrtab_stream);
lto_elf_end_section (); lto_obj_end_section ();
lto_set_current_out_file (old_file); lto_set_current_out_file (old_file);
free (elf_file->shstrtab_stream); free (elf_file->shstrtab_stream);
......
...@@ -1158,11 +1158,11 @@ static void lto_init_ts (void) ...@@ -1158,11 +1158,11 @@ static void lto_init_ts (void)
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table #define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table
#undef LANG_HOOKS_BEGIN_SECTION #undef LANG_HOOKS_BEGIN_SECTION
#define LANG_HOOKS_BEGIN_SECTION lto_elf_begin_section #define LANG_HOOKS_BEGIN_SECTION lto_obj_begin_section
#undef LANG_HOOKS_APPEND_DATA #undef LANG_HOOKS_APPEND_DATA
#define LANG_HOOKS_APPEND_DATA lto_elf_append_data #define LANG_HOOKS_APPEND_DATA lto_obj_append_data
#undef LANG_HOOKS_END_SECTION #undef LANG_HOOKS_END_SECTION
#define LANG_HOOKS_END_SECTION lto_elf_end_section #define LANG_HOOKS_END_SECTION lto_obj_end_section
#undef LANG_HOOKS_INIT_TS #undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS lto_init_ts #define LANG_HOOKS_INIT_TS lto_init_ts
......
...@@ -378,7 +378,7 @@ lto_file_read (lto_file *file, FILE *resolution_file) ...@@ -378,7 +378,7 @@ lto_file_read (lto_file *file, FILE *resolution_file)
file_data = XCNEW (struct lto_file_decl_data); file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename; file_data->file_name = file->filename;
file_data->section_hash_table = lto_elf_build_section_table (file); file_data->section_hash_table = lto_obj_build_section_table (file);
file_data->renaming_hash_table = lto_create_renaming_table (); file_data->renaming_hash_table = lto_create_renaming_table ();
data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len); data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
...@@ -1040,16 +1040,16 @@ lto_wpa_write_files (void) ...@@ -1040,16 +1040,16 @@ lto_wpa_write_files (void)
if (cgraph_node_set_needs_ltrans_p (set)) if (cgraph_node_set_needs_ltrans_p (set))
{ {
/* Write all the nodes in SET to TEMP_FILENAME. */ /* Write all the nodes in SET to TEMP_FILENAME. */
file = lto_elf_file_open (temp_filename, true); file = lto_obj_file_open (temp_filename, true);
if (!file) if (!file)
fatal_error ("lto_elf_file_open() failed"); fatal_error ("lto_obj_file_open() failed");
lto_set_current_out_file (file); lto_set_current_out_file (file);
ipa_write_optimization_summaries (set); ipa_write_optimization_summaries (set);
lto_set_current_out_file (NULL); lto_set_current_out_file (NULL);
lto_elf_file_close (file); lto_obj_file_close (file);
} }
} }
...@@ -1740,17 +1740,17 @@ lto_read_all_file_options (void) ...@@ -1740,17 +1740,17 @@ lto_read_all_file_options (void)
for (i = 0; i < num_in_fnames; i++) for (i = 0; i < num_in_fnames; i++)
{ {
struct lto_file_decl_data *file_data; struct lto_file_decl_data *file_data;
lto_file *file = lto_elf_file_open (in_fnames[i], false); lto_file *file = lto_obj_file_open (in_fnames[i], false);
if (!file) if (!file)
break; break;
file_data = XCNEW (struct lto_file_decl_data); file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename; file_data->file_name = file->filename;
file_data->section_hash_table = lto_elf_build_section_table (file); file_data->section_hash_table = lto_obj_build_section_table (file);
lto_read_file_options (file_data); lto_read_file_options (file_data);
lto_elf_file_close (file); lto_obj_file_close (file);
htab_delete (file_data->section_hash_table); htab_delete (file_data->section_hash_table);
free (file_data); free (file_data);
} }
...@@ -1813,7 +1813,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) ...@@ -1813,7 +1813,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
fflush (stderr); fflush (stderr);
} }
current_lto_file = lto_elf_file_open (fnames[i], false); current_lto_file = lto_obj_file_open (fnames[i], false);
if (!current_lto_file) if (!current_lto_file)
break; break;
...@@ -1823,7 +1823,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) ...@@ -1823,7 +1823,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
all_file_decl_data[last_file_ix++] = file_data; all_file_decl_data[last_file_ix++] = file_data;
lto_elf_file_close (current_lto_file); lto_obj_file_close (current_lto_file);
current_lto_file = NULL; current_lto_file = NULL;
} }
......
...@@ -38,13 +38,13 @@ extern const char *resolution_file_name; ...@@ -38,13 +38,13 @@ extern const char *resolution_file_name;
extern void lto_main (int); extern void lto_main (int);
extern void lto_read_all_file_options (void); extern void lto_read_all_file_options (void);
/* In lto-elf.c */ /* In lto-elf.c or lto-coff.c */
extern lto_file *lto_elf_file_open (const char *filename, bool writable); extern lto_file *lto_obj_file_open (const char *filename, bool writable);
extern void lto_elf_file_close (lto_file *file); extern void lto_obj_file_close (lto_file *file);
extern htab_t lto_elf_build_section_table (lto_file *file); extern htab_t lto_obj_build_section_table (lto_file *file);
extern void lto_elf_begin_section (const char *name); extern void lto_obj_begin_section (const char *name);
extern void lto_elf_append_data (const void *data, size_t len, void *block); extern void lto_obj_append_data (const void *data, size_t len, void *block);
extern void lto_elf_end_section (void); extern void lto_obj_end_section (void);
extern lto_file *lto_set_current_out_file (lto_file *file); extern lto_file *lto_set_current_out_file (lto_file *file);
extern lto_file *lto_get_current_out_file (void); extern lto_file *lto_get_current_out_file (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment