summaryrefslogtreecommitdiff
path: root/gcc/gimple-streamer-in.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-streamer-in.c')
-rw-r--r--gcc/gimple-streamer-in.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index d1930dc281d..21b9c0e07b2 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -59,14 +59,14 @@ along with GCC; see the file COPYING3. If not see
/* Read a PHI function for basic block BB in function FN. DATA_IN is
the file being read. IB is the input block to use for reading. */
-static gimple
+static gphi *
input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in,
struct function *fn)
{
unsigned HOST_WIDE_INT ix;
tree phi_result;
int i, len;
- gimple result;
+ gphi *result;
ix = streamer_read_uhwi (ib);
phi_result = (*SSANAMES (fn))[ix];
@@ -138,21 +138,25 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
switch (code)
{
case GIMPLE_RESX:
- gimple_resx_set_region (stmt, streamer_read_hwi (ib));
+ gimple_resx_set_region (as_a <gresx *> (stmt),
+ streamer_read_hwi (ib));
break;
case GIMPLE_EH_MUST_NOT_THROW:
- gimple_eh_must_not_throw_set_fndecl (stmt, stream_read_tree (ib, data_in));
+ gimple_eh_must_not_throw_set_fndecl (
+ as_a <geh_mnt *> (stmt),
+ stream_read_tree (ib, data_in));
break;
case GIMPLE_EH_DISPATCH:
- gimple_eh_dispatch_set_region (stmt, streamer_read_hwi (ib));
+ gimple_eh_dispatch_set_region (as_a <geh_dispatch *> (stmt),
+ streamer_read_hwi (ib));
break;
case GIMPLE_ASM:
{
/* FIXME lto. Move most of this into a new gimple_asm_set_string(). */
- gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm *> (stmt);
+ gasm *asm_stmt = as_a <gasm *> (stmt);
tree str;
asm_stmt->ni = streamer_read_uhwi (ib);
asm_stmt->no = streamer_read_uhwi (ib);
@@ -200,13 +204,13 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
== TREE_TYPE (TREE_OPERAND (TREE_OPERAND (*opp, 0), 0))))
*opp = TREE_OPERAND (TREE_OPERAND (*opp, 0), 0);
}
- if (is_gimple_call (stmt))
+ if (gcall *call_stmt = dyn_cast <gcall *> (stmt))
{
- if (gimple_call_internal_p (stmt))
+ if (gimple_call_internal_p (call_stmt))
gimple_call_set_internal_fn
- (stmt, streamer_read_enum (ib, internal_fn, IFN_LAST));
+ (call_stmt, streamer_read_enum (ib, internal_fn, IFN_LAST));
else
- gimple_call_set_fntype (stmt, stream_read_tree (ib, data_in));
+ gimple_call_set_fntype (call_stmt, stream_read_tree (ib, data_in));
}
break;
@@ -215,7 +219,8 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
break;
case GIMPLE_TRANSACTION:
- gimple_transaction_set_label (stmt, stream_read_tree (ib, data_in));
+ gimple_transaction_set_label (as_a <gtransaction *> (stmt),
+ stream_read_tree (ib, data_in));
break;
default:
@@ -233,11 +238,12 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
}
else if (code == GIMPLE_ASM)
{
+ gasm *asm_stmt = as_a <gasm *> (stmt);
unsigned i;
- for (i = 0; i < gimple_asm_noutputs (stmt); i++)
+ for (i = 0; i < gimple_asm_noutputs (asm_stmt); i++)
{
- tree op = TREE_VALUE (gimple_asm_output_op (stmt, i));
+ tree op = TREE_VALUE (gimple_asm_output_op (asm_stmt, i));
if (TREE_CODE (op) == SSA_NAME)
SSA_NAME_DEF_STMT (op) = stmt;
}
@@ -245,7 +251,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
/* Reset alias information. */
if (code == GIMPLE_CALL)
- gimple_call_reset_alias_info (stmt);
+ gimple_call_reset_alias_info (as_a <gcall *> (stmt));
/* Mark the statement modified so its operand vectors can be filled in. */
gimple_set_modified (stmt, true);