#include "irprog.h"
#include "irop_t.h"
#include "irgraph_t.h"
-#include "ircgcons.h"
#include "irvrfy_t.h"
#include "irgwalk.h"
#include "irdump.h"
ASSERT_AND_RET(
!is_NoMem(get_Call_mem(n)),
"Exception Proj from FunctionCall", 0);
- else if (proj == pn_Call_M)
- ASSERT_AND_RET(
- (!is_NoMem(get_Call_mem(n)) || 1),
- "Memory Proj from FunctionCall", 0);
return 1;
}
(proj >= 0 && mode_is_datab(mode)),
"wrong Proj from Proj from Call", 0);
mt = get_Call_type(pred);
+ ASSERT_AND_RET(mt == get_unknown_type() || is_Method_type(mt),
+ "wrong call type on call", 0);
ASSERT_AND_RET(
(proj < get_method_n_ress(mt)),
"More Projs for results than results in type.", 0);
return 1;
}
-/**
- * verify a Proj(CallBegin) node
- */
-static int verify_node_Proj_CallBegin(ir_node *n, ir_node *p)
-{
- (void) n;
- (void) p;
- return 1;
-}
-
-/**
- * verify a Proj(EndReg) node
- */
-static int verify_node_Proj_EndReg(ir_node *n, ir_node *p)
-{
- (void) n;
- (void) p;
-#ifdef INTERPROCEDURAL_VIEW
- ASSERT_AND_RET(
- (get_irp_ip_view_state() != ip_view_no),
- "EndReg may only appear if ip view is constructed.", 0);
-#endif
- return 1;
-}
-
-/**
- * verify a Proj(EndExcept) node
- */
-static int verify_node_Proj_EndExcept(ir_node *n, ir_node *p)
-{
- (void) n;
- (void) p;
-#ifdef INTERPROCEDURAL_VIEW
- ASSERT_AND_RET(
- (get_irp_ip_view_state() != ip_view_no),
- "EndExcept may only appear if ip view is constructed.", 0);
-#endif
- return 1;
-}
-
/**
* verify a Proj(CopyB) node
*/
}
for (i = get_Block_n_cfgpreds(n) - 1; i >= 0; --i) {
- ir_node *pred = get_Block_cfgpred(n, i);
+ ir_node *pred = get_Block_cfgpred(n, i);
ASSERT_AND_RET(
is_Bad(pred) || (get_irn_mode(pred) == mode_X),
"Block node must have a mode_X predecessor", 0);
"End Block node", 0);
}
/* irg attr must == graph we are in. */
- if (! get_interprocedural_view()) {
- ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
- }
+ ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
return 1;
}
return 1;
}
-/**
- * verify a Break node
- */
-static int verify_node_Break(ir_node *n, ir_graph *irg)
-{
- ir_mode *mymode = get_irn_mode(n);
- (void) irg;
-
-#ifdef INTERPROCEDURAL_VIEW
- ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
- "Break may only appear if ip view is constructed.", 0);
-#endif
- ASSERT_AND_RET(
- /* Jmp: BB --> X */
- mymode == mode_X, "Break node", 0
- );
- return 1;
-}
-
/**
* verify a Cond node
*/
return 1;
}
-/**
- * verify a Filter node
- */
-static int verify_node_Filter(ir_node *n, ir_graph *irg)
-{
- (void) n;
- (void) irg;
-#ifdef INTERPROCEDURAL_VIEW
- ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
- "Filter may only appear if ip view is constructed.", 0);
-#endif
- /* We should further do tests as for Proj and Phi. */
- return 1;
-}
-
/**
* verify a Load node
*/
}
ASSERT_AND_RET(
- is_compound_type(t),
+ is_compound_type(t) || is_Array_type(t),
"CopyB node should copy compound types only", 0 );
/* NoMem nodes are only allowed as memory input if the CopyB is NOT pinned.
if (!get_node_verification_mode())
return 1;
- if (!get_interprocedural_view()) {
- /*
- * do NOT check placement in interprocedural view, as we don't always know
- * the "right" graph ...
- */
+ /*
+ * do NOT check placement in interprocedural view, as we don't always
+ * know the "right" graph ...
+ */
#ifndef NDEBUG
- /* this seems to be an expensive check in VS compile (9% over all runtime),
- so do NOT run it in release mode */
- ASSERT_AND_RET_DBG(
- node_is_in_irgs_storage(irg, n),
- "Node is not stored on proper IR graph!", 0,
- show_node_on_graph(irg, n);
- );
+ /* this is an expensive check for large graphs (it has a quadratic
+ * runtime but with a small constant); so do NOT run it in release mode
+ */
+ ASSERT_AND_RET_DBG(
+ node_is_in_irgs_storage(irg, n),
+ "Node is not stored on proper IR graph!", 0,
+ show_node_on_graph(irg, n);
+ );
#endif
- assert(get_irn_irg(n) == irg);
- {
- unsigned idx = get_irn_idx(n);
- ir_node *node_from_map = get_idx_irn(irg, idx);
- ASSERT_AND_RET_DBG(node_from_map == n, "Node index and index map entry differ", 0,
- ir_printf("node %+F node in map %+F(%p)\n", n, node_from_map, node_from_map));
- }
+ assert(get_irn_irg(n) == irg);
+ {
+ unsigned idx = get_irn_idx(n);
+ ir_node *node_from_map = get_idx_irn(irg, idx);
+ ASSERT_AND_RET_DBG(node_from_map == n, "Node index and index map entry differ", 0,
+ ir_printf("node %+F node in map %+F(%p)\n", n, node_from_map, node_from_map));
}
op = get_irn_op(n);
fprintf(stderr, "irg_vrfy_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph_sched(current_ir_graph, "-assert");
+ dump_ir_graph(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph_sched(current_ir_graph, "-assert");
+ dump_ir_graph(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph_sched(current_ir_graph, "-assert");
+ dump_ir_graph(current_ir_graph, "-assert");
assert(0 && "Tuple detected");
}
}
fprintf(stderr, "irg_vrfy_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph_sched(current_ir_graph, "-assert");
+ dump_ir_graph(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph_sched(current_ir_graph, "-assert");
+ dump_ir_graph(current_ir_graph, "-assert");
assert(0 && "Bad NON-CF detected");
}
}
CASE(Start);
CASE(Jmp);
CASE(IJmp);
- CASE(Break);
CASE(Cond);
CASE(Return);
CASE(Raise);
CASE(Conv);
CASE(Cast);
CASE(Phi);
- CASE(Filter);
CASE(Load);
CASE(Store);
CASE(Alloc);
CASE(Alloc);
CASE(Proj);
CASE(Tuple);
- CASE(CallBegin);
- CASE(EndReg);
- CASE(EndExcept);
CASE(CopyB);
CASE(Bound);
default: