*/
static void show_node_on_graph(ir_graph *irg, ir_node *n)
{
- entity *ent = get_irg_ent(irg);
+ entity *ent = get_irg_entity(irg);
if (ent)
fprintf(stderr, "\nFIRM: irn_vrfy_irg() of entity %s, node %ld %s%s\n",
*/
static void show_return_modes(ir_graph *irg, ir_node *n, type *mt, int i)
{
- entity *ent = get_irg_ent(irg);
+ entity *ent = get_irg_entity(irg);
fprintf(stderr, "\nFIRM: irn_vrfy_irg() Return node %ld in entity \"%s\" mode %s different from type mode %s\n",
get_irn_node_nr(n), get_entity_name(ent),
*/
static void show_return_nres(ir_graph *irg, ir_node *n, type *mt)
{
- entity *ent = get_irg_ent(irg);
+ entity *ent = get_irg_entity(irg);
fprintf(stderr, "\nFIRM: irn_vrfy_irg() Return node %ld in entity \"%s\" has %d results different from type %d\n",
get_irn_node_nr(n), get_entity_name(ent),
ir_mode *mode;
int proj;
- pred = skip_nop(get_Proj_pred(p));
+ pred = skip_Id(get_Proj_pred(p));
ASSERT_AND_RET(get_irn_mode(pred) == mode_T, "mode of a 'projed' node is not Tuple", 0);
mode = get_irn_mode(p);
proj = get_Proj_proj(p);
case iro_Start:
ASSERT_AND_RET_DBG(
(
- (proj == pns_initial_exec && mode == mode_X) ||
- (proj == pns_global_store && mode == mode_M) ||
- (proj == pns_frame_base && mode_is_reference(mode)) ||
- (proj == pns_globals && mode_is_reference(mode)) ||
- (proj == pns_args && mode == mode_T) ||
- (proj == pns_value_arg_base && mode_is_reference(mode)) ||
- (proj == pns_value_arg_base && mode == mode_T) /* FIXME: only one of those */
+ (proj == pn_Start_X_initial_exec && mode == mode_X) ||
+ (proj == pn_Start_M && mode == mode_M) ||
+ (proj == pn_Start_P_frame_base && mode_is_reference(mode)) ||
+ (proj == pn_Start_P_globals && mode_is_reference(mode)) ||
+ (proj == pn_Start_T_args && mode == mode_T) ||
+ (proj == pn_Start_P_value_arg_base && mode_is_reference(mode)) ||
+ (proj == pn_Start_P_value_arg_base && mode == mode_T) /* FIXME: only one of those */
),
"wrong Proj from Start", 0,
show_proj_failure(p);
case iro_Cond:
ASSERT_AND_RET_DBG(
- (proj >= 0 && mode == mode_X),
- "wrong Proj from Cond", 0,
- show_proj_failure(p);
+ (
+ (proj >= 0 && mode == mode_X && get_irn_mode(get_Cond_selector(pred)) == mode_b) || /* compare */
+ (mode == mode_X && mode_is_int(get_irn_mode(get_Cond_selector(pred)))) /* switch */
+ ),
+ "wrong Proj from Cond", 0,
+ show_proj_failure(p);
);
break;
type *mt; /* A method type */
long nr = get_Proj_proj(pred);
- pred = skip_nop(get_Proj_pred(pred));
+ pred = skip_Id(get_Proj_pred(pred));
ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
switch (get_irn_opcode(pred))
{
case iro_Start:
- mt = get_entity_type(get_irg_ent(irg));
+ mt = get_entity_type(get_irg_entity(irg));
- if (nr == pns_args) {
+ if (nr == pn_Start_T_args) {
ASSERT_AND_RET(
(proj >= 0 && mode_is_data(mode)),
"wrong Proj from Proj from Start", 0);
(mode == get_type_mode(get_method_param_type(mt, proj))),
"Mode of Proj from Start doesn't match mode of param type.", 0);
}
- else if (nr == pns_value_arg_base) {
+ else if (nr == pn_Start_P_value_arg_base) {
ASSERT_AND_RET(
(proj >= 0 && mode_is_reference(mode)),
"wrong Proj from Proj from Start", 0
};
ASSERT_AND_RET( mymode == mode_X, "Result X", 0 ); /* result X */
/* Compare returned results with result types of method type */
- mt = get_entity_type(get_irg_ent(irg));
+ mt = get_entity_type(get_irg_entity(irg));
ASSERT_AND_RET_DBG( get_Return_n_ress(n) == get_method_n_ress(mt),
"Number of results for Return doesn't match number of results in type.", 0,
show_return_nres(irg, n, mt););
break;
case iro_Const: {
- tarval *tv = get_Const_tarval(n);
- if (tarval_is_entity(tv))
- ASSERT_AND_RET(
- (get_irn_irg(n) == get_const_code_irg()) ||
- (get_entity_peculiarity(tarval_to_entity(tv)) != peculiarity_description),
- "descriptions have no address", 0);
- ASSERT_AND_RET(
- /* Const: BB --> data */
- (mode_is_data (mymode) ||
- mymode == mode_b) /* we want boolean constants for static evaluation */
- ,"Const node", 0 /* of Cmp. */
- );
- } break;
+ ASSERT_AND_RET(
+ /* Const: BB --> data */
+ (mode_is_data (mymode) ||
+ mymode == mode_b) /* we want boolean constants for static evaluation */
+ ,"Const node", 0 /* of Cmp. */
+ );
+ } break;
case iro_SymConst:
+ if (get_SymConst_kind(n) == symconst_addr_ent) {
+ entity *ent = get_SymConst_entity(n);
+ if (is_method_type(get_entity_type(ent)) &&
+ get_irn_irg(n) != get_const_code_irg()) {
+#if 0
+ ASSERT_AND_RET((get_entity_peculiarity(ent) != peculiarity_description),
+ "A constant must address an existing method.", 0);
+#endif
+ }
+ }
ASSERT_AND_RET(
/* SymConst: BB --> int*/
(mode_is_int(mymode) ||
op1mode = get_irn_mode(in[1]);
ASSERT_AND_RET_DBG(
/* Minus: BB x float --> float */
- op1mode == mymode && get_mode_sort(op1mode) == irms_float_number, "Minus node", 0,
+ op1mode == mymode && mode_is_float(op1mode), "Minus node", 0,
show_unop_failure(n , "/* Minus: BB x float --> float */");
);
op_is_symmetric = 2;
rem = current_ir_graph;
current_ir_graph = irg;
- assert(get_irg_pinned(irg) == pinned);
+ assert(get_irg_pinned(irg) == op_pin_state_pinned);
irg_walk(irg->end, vrfy_wrap, NULL, &res);