summaryrefslogtreecommitdiff
path: root/gcc/lto-opts.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2011-03-24 08:39:59 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2011-03-24 08:39:59 -0400
commita183b5c7af929e900fa073b48f72ee6436411748 (patch)
treeb074b13ef42fb524859202db77acbd1630928da5 /gcc/lto-opts.c
parentcfef45c8097d122e7dfda42c5e2767bf21a7f649 (diff)
downloadgcc-a183b5c7af929e900fa073b48f72ee6436411748.tar.gz
lto-opts.c (input_data_block): Move to lto-streamer-in.c.
* lto-opts.c (input_data_block): Move to lto-streamer-in.c. * lto-streamer-in.c (input_string_internal): Add clarifying comments. (lto_input_data_block): Move from lto-opts.c. Make extern. Update all users. (lto_input_string): Rename from input_string. Make extern. Update all users. * lto-streamer-out.c (lto_output_string_with_length): Rename from output_string_with_length. Output 0 to indicate a non-NULL string. Update all callers to not emit 0. (lto_output_string): Rename from output_string. Make extern. Update all users. (lto_output_decl_state_streams): Make extern. (lto_output_decl_state_refs): Make extern. * lto-streamer.h (lto_input_string): Declare. (lto_input_data_block): Declare. (lto_output_string): Declare. (lto_output_string_with_length): Declare. (lto_output_decl_state_streams): Declare. (lto_output_decl_state_refs): Declare. From-SVN: r171387
Diffstat (limited to 'gcc/lto-opts.c')
-rw-r--r--gcc/lto-opts.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index ec4e78daf39..9979e8da821 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -162,18 +162,6 @@ output_string_stream (struct lto_output_stream *stream, const char *string)
output_data_stream (stream, &flag, sizeof (flag));
}
-/* Read LENGTH bytes from STREAM to ADDR. */
-
-static void
-input_data_block (struct lto_input_block *ib, void *addr, size_t length)
-{
- size_t i;
- unsigned char *const buffer = (unsigned char *const) addr;
-
- for (i = 0; i < length; i++)
- buffer[i] = lto_input_1_unsigned (ib);
-}
-
/* Return a string from IB. The string is allocated, and the caller is
responsible for freeing it. */
@@ -182,15 +170,15 @@ input_string_block (struct lto_input_block *ib)
{
bool flag;
- input_data_block (ib, &flag, sizeof (flag));
+ lto_input_data_block (ib, &flag, sizeof (flag));
if (flag)
{
size_t length;
char *string;
- input_data_block (ib, &length, sizeof (length));
+ lto_input_data_block (ib, &length, sizeof (length));
string = (char *) xcalloc (1, length + 1);
- input_data_block (ib, string, length);
+ lto_input_data_block (ib, string, length);
return string;
}
@@ -336,16 +324,16 @@ input_options (struct lto_input_block *ib)
{
size_t length, i;
- input_data_block (ib, &length, sizeof (length));
+ lto_input_data_block (ib, &length, sizeof (length));
for (i = 0; i < length; i++)
{
opt_t o;
- input_data_block (ib, &o.type, sizeof (o.type));
- input_data_block (ib, &o.code, sizeof (o.code));
+ lto_input_data_block (ib, &o.type, sizeof (o.type));
+ lto_input_data_block (ib, &o.code, sizeof (o.code));
o.arg = input_string_block (ib);
- input_data_block (ib, &o.value, sizeof (o.value));
+ lto_input_data_block (ib, &o.value, sizeof (o.value));
VEC_safe_push (opt_t, heap, file_options, &o);
}
}