summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c27
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);