#define ASSERT_AND_RET(expr, string, ret) \
do { \
if (opt_do_node_verification == NODE_VERIFICATION_ON) {\
- if (!(expr)) dump_ir_block_graph(current_ir_graph, "-assert"); \
+ if (!(expr) && current_ir_graph != get_const_code_irg()) \
+ dump_ir_block_graph(current_ir_graph, "-assert"); \
assert((expr) && string); } \
if (!(expr)) { \
if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
"wrong Proj from Call", 0,
show_proj_failure(p);
);
- break;
- case iro_FuncCall:
- ASSERT_AND_RET_DBG(
- ((proj == pn_Call_M_regular && mode == mode_M) ||
- (proj == pn_Call_X_except && mode == mode_X) ||
- (proj == pn_Call_T_result && mode == mode_T) ||
- (proj == pn_Call_M_except && mode == mode_M) ||
- (proj == pn_Call_P_value_res_base && mode == mode_P)),
- "wrong Proj from FuncCall", 0,
- show_proj_failure(p);
- );
break;
case iro_Quot:
(proj == pn_Div_X_except && mode == mode_X) ||
(proj == pn_Div_res && mode_is_int(mode))),
"wrong Proj from Div or Mod", 0,
- show_proj_failure(p);
+ show_proj_failure(p);
);
break;
if (proj == pn_Load_res) {
ir_node *ptr = get_Load_ptr(pred);
entity *ent = get_ptr_entity(ptr);
+
if (vrfy_entities && ent && get_irg_phase_state(current_ir_graph) == phase_high) {
/* do NOT check this for lowered phases, see comment on Store */
ASSERT_AND_RET_DBG(
}
else {
ASSERT_AND_RET_DBG(
- mode_is_data(mode),
+ mode_is_data(mode) && mode == get_Load_mode(pred),
"wrong data Proj from Load", 0,
show_proj_failure(p);
);
ASSERT_AND_RET(
(mode == get_type_mode(get_method_res_type(mt, proj))),
"Mode of Proj from Call doesn't match mode of result type.", 0);
- }
- break;
-
- case iro_FuncCall:
- {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_data(mode)),
- "wrong Proj from Proj from FuncCall", 0);
- mt = get_FuncCall_type(pred);
- ASSERT_AND_RET(
- (proj < get_method_n_ress(mt)),
- "More Projs for results than results in type.", 0);
- if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
- /* value result */ break;
- ASSERT_AND_RET(
- (mode == get_type_mode(get_method_res_type(mt, proj))),
- "Mode of Proj from FuncCall doesn't match mode of result type.", 0);
}
break;
if (!opt_do_node_verification) return 1;
- if (! interprocedural_view) {
+ if (! get_interprocedural_view()) {
/*
* do NOT check placement in interprocedural view, as we don't always know
* the "right" graph ...
"End Block node", 0);
}
/* irg attr must == graph we are in. */
- if (! interprocedural_view) {
+ if (! get_interprocedural_view()) {
ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
}
/* Call: BB x M x ref x data1 x ... x datan
--> M x datan+1 x ... x data n+m */
ASSERT_AND_RET( op1mode == mode_M && mode_is_reference(op2mode), "Call node", 0 ); /* operand M x ref */
+
+ mt = get_Call_type(n);
+ if(get_unknown_type() == mt) {
+ break;
+ }
+
for (i=3; i < get_irn_arity(n); i++) {
ASSERT_AND_RET( mode_is_data(get_irn_mode(in[i])), "Call node", 0 ); /* operand datai */
};
ASSERT_AND_RET( mymode == mode_T, "Call result not a tuple", 0 ); /* result T */
/* Compare arguments of node with those of type */
- mt = get_Call_type(n);
if (get_method_variadicity(mt) == variadicity_variadic) {
ASSERT_AND_RET_DBG(
}
for (i = 0; i < get_method_n_params(mt); i++) {
- type *t = get_method_param_type(mt, i);
+ type *t = get_method_param_type(mt, i);
- if (is_atomic_type(t)) {
- ASSERT_AND_RET_DBG(
- get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
- "Mode of arg for Call doesn't match mode of arg type.", 0,
- show_call_param(n, mt);
- );
- }
- else {
- /* call with a compound type, mode must be reference */
- ASSERT_AND_RET_DBG(
- mode_is_reference(get_irn_mode(get_Call_param(n, i))),
- "Mode of arg for Call doesn't match mode of arg type.", 0,
- show_call_param(n, mt);
- );
- }
+ if (is_atomic_type(t)) {
+ ASSERT_AND_RET_DBG(
+ get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
+ "Mode of arg for Call doesn't match mode of arg type.", 0,
+ show_call_param(n, mt);
+ );
+ }
+ else {
+ /* call with a compound type, mode must be reference */
+ ASSERT_AND_RET_DBG(
+ mode_is_reference(get_irn_mode(get_Call_param(n, i))),
+ "Mode of arg for Call doesn't match mode of arg type.", 0,
+ show_call_param(n, mt);
+ );
+ }
}
+
+#if 0
+ if (Call_has_callees(n)) {
+ for (i = 0; i < get_Call_n_callees(n); i++) {
+ ASSERT_AND_RET(is_entity(get_Call_callee(n, i)), "callee array must contain entities.", 0);
+ }
+ }
+#endif
break;
case iro_Add: