bp_pack_value (&bp, node->alias, 1);
bp_pack_value (&bp, node->finalized_by_frontend, 1);
bp_pack_value (&bp, node->frequency, 2);
+ bp_pack_value (&bp, node->only_called_at_startup, 1);
+ bp_pack_value (&bp, node->only_called_at_exit, 1);
lto_output_bitpack (&bp);
+ lto_output_uleb128_stream (ob->main_stream, node->resolution);
if (node->same_body)
{
lto_output_fn_decl_index (ob->decl_state, ob->main_stream,
alias->thunk.alias);
}
+ lto_output_uleb128_stream (ob->main_stream, alias->resolution);
alias = alias->previous;
}
while (alias);
bp_pack_value (&bp, node->force_output, 1);
bp_pack_value (&bp, node->finalized, 1);
bp_pack_value (&bp, node->alias, 1);
- bp_pack_value (&bp, node->const_value_known, 1);
gcc_assert (!node->alias || !node->extra_name);
gcc_assert (node->finalized || !node->analyzed);
gcc_assert (node->needed);
else
ref = LCC_NOT_FOUND;
lto_output_sleb128_stream (ob->main_stream, ref);
+ lto_output_uleb128_stream (ob->main_stream, node->resolution);
if (count)
{
lto_output_uleb128_stream (ob->main_stream, count);
for (alias = node->extra_name; alias; alias = alias->next)
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, alias->decl);
+ {
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, alias->decl);
+ lto_output_uleb128_stream (ob->main_stream, alias->resolution);
+ }
}
}
if (DECL_INITIAL (vnode->decl)
&& !lto_varpool_encoder_encode_initializer_p (varpool_encoder,
vnode)
- && (DECL_IN_CONSTANT_POOL (vnode->decl)
- || vnode->const_value_known))
+ && const_value_known_p (vnode->decl))
{
lto_set_varpool_encoder_encode_initializer (varpool_encoder, vnode);
add_references (encoder, varpool_encoder, &vnode->ref_list);
unsigned int self_time,
unsigned int time_inlining_benefit,
unsigned int self_size,
- unsigned int size_inlining_benefit)
+ unsigned int size_inlining_benefit,
+ enum ld_plugin_symbol_resolution resolution)
{
node->aux = (void *) tag;
node->local.inline_summary.estimated_self_stack_size = stack_size;
node->alias = bp_unpack_value (bp, 1);
node->finalized_by_frontend = bp_unpack_value (bp, 1);
node->frequency = (enum node_frequency)bp_unpack_value (bp, 2);
+ node->only_called_at_startup = bp_unpack_value (bp, 1);
+ node->only_called_at_exit = bp_unpack_value (bp, 1);
+ node->resolution = resolution;
}
/* Output the part of the cgraph in SET. */
int size_inlining_benefit = 0;
unsigned long same_body_count = 0;
int clone_ref;
+ enum ld_plugin_symbol_resolution resolution;
clone_ref = lto_input_sleb128 (ib);
"node %d", node->uid);
bp = lto_input_bitpack (ib);
+ resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib);
input_overwrite_node (file_data, node, tag, &bp, stack_size, self_time,
time_inlining_benefit, self_size,
- size_inlining_benefit);
+ size_inlining_benefit, resolution);
/* Store a reference for now, and fix up later to be a pointer. */
node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref;
{
tree alias_decl;
int type;
+ struct cgraph_node *alias;
decl_index = lto_input_uleb128 (ib);
alias_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
type = lto_input_uleb128 (ib);
tree real_alias;
decl_index = lto_input_uleb128 (ib);
real_alias = lto_file_decl_data_get_fn_decl (file_data, decl_index);
- cgraph_same_body_alias (alias_decl, real_alias);
+ alias = cgraph_same_body_alias (alias_decl, real_alias);
}
else
{
tree real_alias;
decl_index = lto_input_uleb128 (ib);
real_alias = lto_file_decl_data_get_fn_decl (file_data, decl_index);
- cgraph_add_thunk (alias_decl, fn_decl, type & 2, fixed_offset,
- virtual_value,
- (type & 4) ? size_int (virtual_value) : NULL_TREE,
- real_alias);
+ alias = cgraph_add_thunk (alias_decl, fn_decl, type & 2, fixed_offset,
+ virtual_value,
+ (type & 4) ? size_int (virtual_value) : NULL_TREE,
+ real_alias);
}
+ alias->resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib);
}
return node;
}
node->force_output = bp_unpack_value (&bp, 1);
node->finalized = bp_unpack_value (&bp, 1);
node->alias = bp_unpack_value (&bp, 1);
- node->const_value_known = bp_unpack_value (&bp, 1);
node->analyzed = node->finalized;
node->used_from_other_partition = bp_unpack_value (&bp, 1);
node->in_other_partition = bp_unpack_value (&bp, 1);
ref = lto_input_sleb128 (ib);
/* Store a reference for now, and fix up later to be a pointer. */
node->same_comdat_group = (struct varpool_node *) (intptr_t) ref;
+ node->resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib);
if (aliases_p)
{
count = lto_input_uleb128 (ib);
{
tree decl = lto_file_decl_data_get_var_decl (file_data,
lto_input_uleb128 (ib));
- varpool_extra_name_alias (decl, var_decl);
+ struct varpool_node *alias;
+ alias = varpool_extra_name_alias (decl, var_decl);
+ alias->resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib);
}
}
return node;
|| profile_info->sum_all != lto_input_sleb128 (ib)
|| profile_info->run_max != lto_input_sleb128 (ib)
|| profile_info->sum_max != lto_input_sleb128 (ib))
- sorry ("Combining units with different profiles is not supported.");
+ sorry ("combining units with different profiles is not supported");
/* We allow some units to have profile and other to not have one. This will
just make unprofiled units to be size optimized that is sane. */
}
ib = lto_create_simple_input_block (file_data, LTO_section_cgraph,
&data, &len);
+ if (!ib)
+ fatal_error ("cannot find LTO cgraph in %s", file_data->file_name);
input_profile_summary (ib);
file_data->cgraph_node_encoder = lto_cgraph_encoder_new ();
nodes = input_cgraph_1 (file_data, ib);
ib = lto_create_simple_input_block (file_data, LTO_section_varpool,
&data, &len);
+ if (!ib)
+ fatal_error ("cannot find LTO varpool in %s", file_data->file_name);
varpool = input_varpool_1 (file_data, ib);
lto_destroy_simple_input_block (file_data, LTO_section_varpool,
ib, data, len);
ib = lto_create_simple_input_block (file_data, LTO_section_refs,
&data, &len);
+ if (!ib)
+ fatal_error("cannot find LTO section refs in %s", file_data->file_name);
input_refs (ib, nodes, varpool);
lto_destroy_simple_input_block (file_data, LTO_section_refs,
ib, data, len);