static inline var_ann_t
var_ann (tree t)
{
-#if defined ENABLE_CHECKING
- if (t == NULL_TREE
- || !DECL_P (t)
- || (t->common.ann
- && t->common.ann->common.type != VAR_ANN))
- abort ();
-#endif
+ gcc_assert (t);
+ gcc_assert (DECL_P (t));
+ gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
return (var_ann_t) t->common.ann;
}
static inline stmt_ann_t
stmt_ann (tree t)
{
-#if defined ENABLE_CHECKING
- if (!is_gimple_stmt (t))
- abort ();
+#ifdef ENABLE_CHECKING
+ gcc_assert (is_gimple_stmt (t));
#endif
-
return (stmt_ann_t) t->common.ann;
}
static inline basic_block
bb_for_stmt (tree t)
{
- stmt_ann_t ann = stmt_ann (t);
+ stmt_ann_t ann;
+
+ if (TREE_CODE (t) == PHI_NODE)
+ return PHI_BB (t);
+
+ ann = stmt_ann (t);
return ann ? ann->bb : NULL;
}
static inline use_operand_p
get_use_op_ptr (use_optype uses, unsigned int index)
{
-#ifdef ENABLE_CHECKING
- if (index >= uses->num_uses)
- abort();
-#endif
+ gcc_assert (index < uses->num_uses);
return uses->uses[index];
}
static inline def_operand_p
get_def_op_ptr (def_optype defs, unsigned int index)
{
-#ifdef ENABLE_CHECKING
- if (index >= defs->num_defs)
- abort();
-#endif
+ gcc_assert (index < defs->num_defs);
return defs->defs[index];
}
get_v_may_def_result_ptr(v_may_def_optype v_may_defs, unsigned int index)
{
def_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_may_defs->num_v_may_defs)
- abort();
-#endif
+ gcc_assert (index < v_may_defs->num_v_may_defs);
op.def = &(v_may_defs->v_may_defs[index].def);
return op;
}
get_v_may_def_op_ptr(v_may_def_optype v_may_defs, unsigned int index)
{
use_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_may_defs->num_v_may_defs)
- abort();
-#endif
+ gcc_assert (index < v_may_defs->num_v_may_defs);
op.use = &(v_may_defs->v_may_defs[index].use);
return op;
}
get_vuse_op_ptr(vuse_optype vuses, unsigned int index)
{
use_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= vuses->num_vuses)
- abort();
-#endif
+ gcc_assert (index < vuses->num_vuses);
op.use = &(vuses->vuses[index]);
return op;
}
get_v_must_def_op_ptr (v_must_def_optype v_must_defs, unsigned int index)
{
def_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_must_defs->num_v_must_defs)
- abort();
-#endif
+ gcc_assert (index < v_must_defs->num_v_must_defs);
op.def = &(v_must_defs->v_must_defs[index]);
return op;
}
static dataflow_t
get_immediate_uses (tree stmt)
{
- stmt_ann_t ann = stmt_ann (stmt);
+ stmt_ann_t ann;
+
+ if (TREE_CODE (stmt) == PHI_NODE)
+ return PHI_DF (stmt);
+
+ ann = stmt_ann (stmt);
return ann ? ann->df : NULL;
}
return NULL_TREE;
#ifdef ENABLE_CHECKING
- if (num >= num_immediate_uses (df))
- abort ();
+ gcc_assert (num < num_immediate_uses (df));
#endif
if (num < 2)
return df->uses[num];
phi_arg_from_edge (tree phi, edge e)
{
int i;
-#if defined ENABLE_CHECKING
- if (!phi || TREE_CODE (phi) != PHI_NODE)
- abort();
-#endif
+ gcc_assert (phi);
+ gcc_assert (TREE_CODE (phi) == PHI_NODE);
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
if (PHI_ARG_EDGE (phi, i) == e)
if (TREE_CODE (t) == SSA_NAME)
return true;
#ifdef ENABLE_CHECKING
- if (!is_gimple_min_invariant (t))
- abort ();
+ gcc_assert (is_gimple_min_invariant (t));
#endif
return false;
}
bsi.tsi = tsi_start (bb->stmt_list);
else
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
}
if (!bb->stmt_list)
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
return bsi;
be placed at the start of the basic block. This would not work if the
first statement was not label; rather fail here than enable the user
proceed in wrong way. */
- if (TREE_CODE (tsi_stmt (bsi.tsi)) != LABEL_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (tsi_stmt (bsi.tsi)) == LABEL_EXPR);
next = bsi.tsi;
tsi_next (&next);
bsi.tsi = tsi_last (bb->stmt_list);
else
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
}