Commit 337cdf24 authored by Matthias Braun's avatar Matthias Braun
Browse files

do not make irverify code dependent on NDEBUG

parent 77784cb8
......@@ -6761,8 +6761,10 @@ ir_node *optimize_in_place_2(ir_node *n)
n = transform_node(n);
#ifdef DEBUG_libfirm
/* Now we can verify the node, as it has no dead inputs any more. */
irn_verify(n);
#endif
/* Now we have a legal, useful node. Enter it in hash table for cse.
*
......
......@@ -24,8 +24,6 @@
const char *firm_verify_failure_msg;
#ifndef NDEBUG
/**
* little helper for NULL modes
*/
......@@ -128,6 +126,7 @@ static void show_proj_mode_failure(const ir_node *n, ir_type *ty)
get_mode_name_ex(m));
}
#ifdef DEBUG_libfirm
/**
* Show a node and a graph
*/
......@@ -135,6 +134,7 @@ static void show_node_on_graph(const ir_graph *irg, const ir_node *n)
{
ir_fprintf(stderr, "\nFIRM: irn_verify_irg() of %+F, node %+F\n", irg, n);
}
#endif
/**
* Show call parameters
......@@ -212,8 +212,6 @@ static void show_phi_inputs(const ir_node *phi, const ir_node *block)
get_irn_node_nr(block), get_irn_arity(block));
}
#endif /* #ifndef NDEBUG */
/**
* verify a Proj(Start) node
*/
......@@ -1467,7 +1465,7 @@ int irn_verify_irg(const ir_node *n, ir_graph *irg)
* know the "right" graph ...
*/
#ifndef NDEBUG
#ifdef DEBUG_libfirm
/* 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
*/
......@@ -1517,12 +1515,7 @@ int irn_verify_irg(const ir_node *n, ir_graph *irg)
int irn_verify(const ir_node *n)
{
#ifdef DEBUG_libfirm
return irn_verify_irg(n, get_irn_irg(n));
#else
(void)n;
return 1;
#endif
}
/*-----------------------------------------------------------------*/
......@@ -1723,9 +1716,7 @@ int irg_verify(ir_graph *irg, unsigned flags)
#ifdef DEBUG_libfirm
int pinned = get_irg_pinned(irg) == op_pin_state_pinned;
#ifndef NDEBUG
last_irg_error = NULL;
#endif /* NDEBUG */
if (pinned && !check_cfg(irg))
res = 0;
......
......@@ -19,19 +19,6 @@
extern const char *firm_verify_failure_msg;
#ifdef NDEBUG
/*
* in RELEASE mode, returns ret if the expression expr evaluates to zero
* in ASSERT mode, asserts the expression expr (and the string string).
*/
#define ASSERT_AND_RET(expr, string, ret) do { if (!(expr)) return (ret); } while (0)
/*
* in RELEASE mode, returns ret if the expression expr evaluates to zero
* in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts expr
*/
#define ASSERT_AND_RET_DBG(expr, string, ret, blk) do { if (!(expr)) return (ret); } while (0)
#else
#define ASSERT_AND_RET(expr, string, ret) \
do { \
if (opt_do_node_verification == FIRM_VERIFICATION_ON) {\
......@@ -62,8 +49,6 @@ do { \
} \
} while(0)
#endif
/**
* Set the default verify_node and verify_proj_node operations.
*/
......
......@@ -22,6 +22,13 @@
#include "irgopt.h"
{% endif %}
static void verify_new_node(ir_graph *irg, ir_node *node)
{
#ifdef DEBUG_libfirm
irn_verify_irg(node, irg);
#endif
}
{% if spec.external %}
static unsigned {{spec.name}}_opcode_start;
......@@ -83,7 +90,7 @@ ir_node *new_rd_{{node.name}}(
{%- endfor %}
{%- endif %}
{{- node.init }}
irn_verify_irg(res, irg);
verify_new_node(irg, res);
res = optimize_node(res);
{{- node.init_after_opt }}
return res;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment