+2015-08-06 Richard Biener <rguenther@suse.de>
+
+ * gimple.h (gimple_call_set_fn): Access op member directly.
+ (gimple_call_chain_ptr): Likewise.
+ (gimple_call_set_chain): Likewise.
+ (gimple_cond_lhs_ptr): Likewise.
+ (gimple_cond_set_lhs): Likewise.
+ (gimple_cond_rhs_ptr): Likewise.
+ (gimple_cond_set_rhs): Likewise.
+ (gimple_cond_true_label): Likewise.
+ (gimple_cond_set_true_label): Likewise.
+ (gimple_cond_set_false_label): Likewise.
+ (gimple_cond_false_label): Likewise.
+ (gimple_label_label): Likewise.
+ (gimple_label_set_label): Likewise.
+ (gimple_goto_set_dest): Likewise.
+ (gimple_asm_input_op): Likewise.
+ (gimple_asm_input_op_ptr): Likewise.
+ (gimple_asm_set_input_op): Likewise.
+ (gimple_asm_output_op): Likewise.
+ (gimple_asm_output_op_ptr): Likewise.
+ (gimple_asm_set_output_op): Likewise.
+ (gimple_asm_clobber_op): Likewise.
+ (gimple_asm_set_clobber_op): Likewise.
+ (gimple_asm_label_op): Likewise.
+ (gimple_asm_set_label_op): Likewise.
+ (gimple_switch_index): Likewise.
+ (gimple_switch_index_ptr): Likewise.
+ (gimple_return_retval_ptr): Likewise.
+ (gimple_return_retval): Likewise.
+ (gimple_return_set_retval): Likewise.
+ (gimple_switch_set_index): Likewise. Remove superfluous GIMPLE_CHECK.
+ (gimple_switch_label): Likewise.
+ (gimple_switch_set_label): Likewise.
+
2015-08-06 Richard Biener <rguenther@suse.de>
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Simplify
gimple_call_set_fn (gcall *gs, tree fn)
{
gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
- gimple_set_op (gs, 1, fn);
+ gs->op[1] = fn;
}
static inline tree *
gimple_call_chain_ptr (const gcall *call_stmt)
{
- return gimple_op_ptr (call_stmt, 2);
+ return const_cast<tree *> (&call_stmt->op[2]);
}
/* Set CHAIN to be the static chain for call statement CALL_STMT. */
static inline void
gimple_call_set_chain (gcall *call_stmt, tree chain)
{
- gimple_set_op (call_stmt, 2, chain);
+ call_stmt->op[2] = chain;
}
static inline tree *
gimple_cond_lhs_ptr (const gcond *gs)
{
- return gimple_op_ptr (gs, 0);
+ return const_cast<tree *> (&gs->op[0]);
}
/* Set LHS to be the LHS operand of the predicate computed by
static inline void
gimple_cond_set_lhs (gcond *gs, tree lhs)
{
- gimple_set_op (gs, 0, lhs);
+ gs->op[0] = lhs;
}
static inline tree *
gimple_cond_rhs_ptr (const gcond *gs)
{
- return gimple_op_ptr (gs, 1);
+ return const_cast<tree *> (&gs->op[1]);
}
static inline void
gimple_cond_set_rhs (gcond *gs, tree rhs)
{
- gimple_set_op (gs, 1, rhs);
+ gs->op[1] = rhs;
}
static inline tree
gimple_cond_true_label (const gcond *gs)
{
- return gimple_op (gs, 2);
+ return gs->op[2];
}
static inline void
gimple_cond_set_true_label (gcond *gs, tree label)
{
- gimple_set_op (gs, 2, label);
+ gs->op[2] = label;
}
static inline void
gimple_cond_set_false_label (gcond *gs, tree label)
{
- gimple_set_op (gs, 3, label);
+ gs->op[3] = label;
}
static inline tree
gimple_cond_false_label (const gcond *gs)
{
-
- return gimple_op (gs, 3);
+ return gs->op[3];
}
static inline tree
gimple_label_label (const glabel *gs)
{
- return gimple_op (gs, 0);
+ return gs->op[0];
}
static inline void
gimple_label_set_label (glabel *gs, tree label)
{
- gimple_set_op (gs, 0, label);
+ gs->op[0] = label;
}
static inline void
gimple_goto_set_dest (ggoto *gs, tree dest)
{
- gimple_set_op (gs, 0, dest);
+ gs->op[0] = dest;
}
gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->ni);
- return gimple_op (asm_stmt, index + asm_stmt->no);
+ return asm_stmt->op[index + asm_stmt->no];
}
/* Return a pointer to input operand INDEX of GIMPLE_ASM ASM_STMT. */
gimple_asm_input_op_ptr (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->ni);
- return gimple_op_ptr (asm_stmt, index + asm_stmt->no);
+ return const_cast<tree *> (&asm_stmt->op[index + asm_stmt->no]);
}
{
gcc_gimple_checking_assert (index < asm_stmt->ni
&& TREE_CODE (in_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->no, in_op);
+ asm_stmt->op[index + asm_stmt->no] = in_op;
}
gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->no);
- return gimple_op (asm_stmt, index);
+ return asm_stmt->op[index];
}
/* Return a pointer to output operand INDEX of GIMPLE_ASM ASM_STMT. */
gimple_asm_output_op_ptr (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->no);
- return gimple_op_ptr (asm_stmt, index);
+ return const_cast<tree *> (&asm_stmt->op[index]);
}
{
gcc_gimple_checking_assert (index < asm_stmt->no
&& TREE_CODE (out_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index, out_op);
+ asm_stmt->op[index] = out_op;
}
gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->nc);
- return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no);
+ return asm_stmt->op[index + asm_stmt->ni + asm_stmt->no];
}
{
gcc_gimple_checking_assert (index < asm_stmt->nc
&& TREE_CODE (clobber_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no, clobber_op);
+ asm_stmt->op[index + asm_stmt->ni + asm_stmt->no] = clobber_op;
}
/* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
{
gcc_gimple_checking_assert (index < asm_stmt->nl);
- return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc);
+ return asm_stmt->op[index + asm_stmt->ni + asm_stmt->nc];
}
/* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
{
gcc_gimple_checking_assert (index < asm_stmt->nl
&& TREE_CODE (label_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc, label_op);
+ asm_stmt->op[index + asm_stmt->ni + asm_stmt->nc] = label_op;
}
/* Return the string representing the assembly instruction in
static inline tree
gimple_switch_index (const gswitch *gs)
{
- return gimple_op (gs, 0);
+ return gs->op[0];
}
static inline tree *
gimple_switch_index_ptr (const gswitch *gs)
{
- return gimple_op_ptr (gs, 0);
+ return const_cast<tree *> (&gs->op[0]);
}
static inline void
gimple_switch_set_index (gswitch *gs, tree index)
{
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
- gimple_set_op (gs, 0, index);
+ gs->op[0] = index;
}
static inline tree
gimple_switch_label (const gswitch *gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
- return gimple_op (gs, index + 1);
+ return gs->op[index + 1];
}
/* Set the label number INDEX to LABEL. 0 is always the default label. */
static inline void
gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
{
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
&& (label == NULL_TREE
|| TREE_CODE (label) == CASE_LABEL_EXPR));
- gimple_set_op (gs, index + 1, label);
+ gs->op[index + 1] = label;
}
/* Return the default label for a switch statement. */
static inline tree *
gimple_return_retval_ptr (const greturn *gs)
{
- return gimple_op_ptr (gs, 0);
+ return const_cast<tree *> (&gs->op[0]);
}
/* Return the return value for GIMPLE_RETURN GS. */
static inline tree
gimple_return_retval (const greturn *gs)
{
- return gimple_op (gs, 0);
+ return gs->op[0];
}
static inline void
gimple_return_set_retval (greturn *gs, tree retval)
{
- gimple_set_op (gs, 0, retval);
+ gs->op[0] = retval;
}