/* Routines for emitting GIMPLE to a file stream.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2013 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@google.com>
This file is part of GCC.
{
stream_write_tree (ob, gimple_phi_arg_def (phi, i), true);
streamer_write_uhwi (ob, gimple_phi_arg_edge (phi, i)->src->index);
- lto_output_location (ob, gimple_phi_arg_location (phi, i));
+ bitpack_d bp = bitpack_create (ob->main_stream);
+ stream_output_location (ob, &bp, gimple_phi_arg_location (phi, i));
+ streamer_write_bitpack (&bp);
}
}
bp_pack_value (&bp, gimple_assign_nontemporal_move_p (stmt), 1);
bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1);
bp_pack_var_len_unsigned (&bp, stmt->gsbase.subcode);
- streamer_write_bitpack (&bp);
/* Emit location information for the statement. */
- lto_output_location (ob, gimple_location (stmt));
+ stream_output_location (ob, &bp, LOCATION_LOCUS (gimple_location (stmt)));
+ streamer_write_bitpack (&bp);
/* Emit the lexical block holding STMT. */
stream_write_tree (ob, gimple_block (stmt), true);
for (i = 0; i < gimple_num_ops (stmt); i++)
{
tree op = gimple_op (stmt, i);
+ tree *basep = NULL;
/* Wrap all uses of non-automatic variables inside MEM_REFs
so that we do not have to deal with type mismatches on
merged symbols during IL read in. The first operand
of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */
if (op && (i || !is_gimple_debug (stmt)))
{
- tree *basep = &op;
+ basep = &op;
while (handled_component_p (*basep))
basep = &TREE_OPERAND (*basep, 0);
if (TREE_CODE (*basep) == VAR_DECL
(TREE_TYPE (*basep)), 0));
TREE_THIS_VOLATILE (*basep) = volatilep;
}
+ else
+ basep = NULL;
}
stream_write_tree (ob, op, true);
+ /* Restore the original base if we wrapped it inside a MEM_REF. */
+ if (basep)
+ *basep = TREE_OPERAND (TREE_OPERAND (*basep, 0), 0);
}
if (is_gimple_call (stmt))
{
streamer_write_uhwi (ob, bb->index);
streamer_write_hwi (ob, bb->count);
- streamer_write_hwi (ob, bb->loop_depth);
streamer_write_hwi (ob, bb->frequency);
streamer_write_hwi (ob, bb->flags);
/* Only emit PHIs for gimple registers. PHI nodes for .MEM
will be filled in on reading when the SSA form is
updated. */
- if (is_gimple_reg (gimple_phi_result (phi)))
+ if (!virtual_operand_p (gimple_phi_result (phi)))
output_phi (ob, phi);
}