@@ -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;
@@ -170,6 +170,9 @@ lto_output_string_with_length (struct output_block *ob,
s_slot.len = len;
s_slot.slot_num = 0;
+ /* Indicate that this is not a NULL string. */
+ lto_output_uleb128_stream (index_stream, 0);
+
slot = (struct string_slot **) htab_find_slot (ob->string_hash_table,
&s_slot, INSERT);
if (*slot == NULL)
@@ -206,11 +209,8 @@ lto_output_string (struct output_block *ob,
const char *string)
{
if (string)
- {
- lto_output_uleb128_stream (index_stream, 0);
- lto_output_string_with_length (ob, index_stream, string,
- strlen (string) + 1);
- }
+ lto_output_string_with_length (ob, index_stream, string,
+ strlen (string) + 1);
else
lto_output_uleb128_stream (index_stream, 1);
}
@@ -225,12 +225,9 @@ output_string_cst (struct output_block *ob,
tree string)
{
if (string)
- {
- lto_output_uleb128_stream (index_stream, 0);
- lto_output_string_with_length (ob, index_stream,
- TREE_STRING_POINTER (string),
- TREE_STRING_LENGTH (string));
- }
+ lto_output_string_with_length (ob, index_stream,
+ TREE_STRING_POINTER (string),
+ TREE_STRING_LENGTH (string ));
else
lto_output_uleb128_stream (index_stream, 1);
}
@@ -245,12 +242,9 @@ output_identifier (struct output_block *ob,
tree id)
{
if (id)
- {
- lto_output_uleb128_stream (index_stream, 0);
- lto_output_string_with_length (ob, index_stream,
- IDENTIFIER_POINTER (id),
- IDENTIFIER_LENGTH (id));
- }
+ lto_output_string_with_length (ob, index_stream,
+ IDENTIFIER_POINTER (id),
+ IDENTIFIER_LENGTH (id));
else
lto_output_uleb128_stream (index_stream, 1);
}