diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 12:39:59 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 12:39:59 +0000 |
commit | 284cc4806917b7677ea5e0780a3dbaddadff325a (patch) | |
tree | b074b13ef42fb524859202db77acbd1630928da5 /gcc/lto-streamer-in.c | |
parent | 1d0b727d82c306aeef33ed287bec5aa9594bc4b0 (diff) | |
download | gcc-284cc4806917b7677ea5e0780a3dbaddadff325a.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171387 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r-- | gcc/lto-streamer-in.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index a87325835f2..383bfc23060 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -140,7 +140,10 @@ input_string_internal (struct data_in *data_in, struct lto_input_block *ib, unsigned int loc; const char *result; + /* Read the location of the string from IB. */ loc = lto_input_uleb128 (ib); + + /* Get the string stored at location LOC in DATA_IN->STRINGS. */ LTO_INIT_INPUT_BLOCK (str_tab, data_in->strings, loc, data_in->strings_len); len = lto_input_uleb128 (&str_tab); *rlen = len; @@ -191,10 +194,24 @@ input_identifier (struct data_in *data_in, struct lto_input_block *ib) return get_identifier_with_length (ptr, len); } + +/* Read LENGTH bytes from STREAM to ADDR. */ + +void +lto_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); +} + + /* Read a NULL terminated string from the string table in DATA_IN. */ -static const char * -input_string (struct data_in *data_in, struct lto_input_block *ib) +const char * +lto_input_string (struct data_in *data_in, struct lto_input_block *ib) { unsigned int len; const char *ptr; @@ -275,7 +292,7 @@ lto_input_location (struct lto_input_block *ib, struct data_in *data_in) { expanded_location xloc; - xloc.file = input_string (data_in, ib); + xloc.file = lto_input_string (data_in, ib); if (xloc.file == NULL) return UNKNOWN_LOCATION; @@ -2307,7 +2324,7 @@ lto_input_ts_translation_unit_decl_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr) { - TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (input_string (data_in, ib)); + TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (lto_input_string (data_in, ib)); VEC_safe_push (tree, gc, all_translation_units, expr); } @@ -2590,7 +2607,7 @@ lto_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in) else gcc_unreachable (); - asmname = input_string (data_in, ib); + asmname = lto_input_string (data_in, ib); if (asmname) set_builtin_user_assembler_name (result, asmname); |