Commit 872780dd authored by Matthias Braun's avatar Matthias Braun
Browse files

remove verification sflag

parent 337cdf24
......@@ -142,33 +142,6 @@ FIRM_API void all_optimizations_off(void);
/** @} */
/** @ingroup irverify
* @defgroup irverify_flags Flags
* Enable/Disable automatic correctness tests
* @{
*/
/**
* Possible verification modes.
*/
typedef enum firm_verification_t {
FIRM_VERIFICATION_OFF = 0, /**< do not verify nodes at all */
FIRM_VERIFICATION_ON = 1, /**< do node verification and assert on error in debug version */
FIRM_VERIFICATION_REPORT = 2, /**< do node verification, but report to stderr only */
FIRM_VERIFICATION_ERROR_ONLY = 3 /**< do node verification, but NEVER do assert nor report */
} firm_verification_t;
/**
* Select verification of IR nodes and types.
*
* Per default the verification is in mode NODE_VERIFICATION_ASSERT.
* Turn the verification off during development to check partial
* implementations.
*/
FIRM_API void do_node_verification(firm_verification_t mode);
/** @} */
#include "end.h"
#endif
......@@ -125,10 +125,3 @@ void firm_init_flags(void)
lc_opt_entry_t *grp = lc_opt_get_grp(firm_opt_get_root(), "opt");
lc_opt_add_table(grp, firm_flags);
}
firm_verification_t opt_do_node_verification = FIRM_VERIFICATION_ON;
void do_node_verification(firm_verification_t mode)
{
opt_do_node_verification = mode;
}
......@@ -44,7 +44,6 @@ typedef enum {
} libfirm_running_t;
extern optimization_state_t libFIRM_opt, libFIRM_running, libFIRM_verb;
extern firm_verification_t opt_do_node_verification;
/** initialises the flags */
void firm_init_flags(void);
......@@ -82,11 +81,6 @@ static inline int get_optimize_(void)
return get_opt_optimize();
}
static inline firm_verification_t get_node_verification_mode(void)
{
return opt_do_node_verification;
}
#define get_optimize() get_optimize_()
#define get_opt_cse() get_opt_cse_()
......
......@@ -159,9 +159,6 @@ parse_error(read_env_t *env, const char *fmt, ...)
fprintf(stderr, "%s:%u: error ", env->inputname, line);
env->read_errors = true;
/* let's hope firm doesn't die on further errors */
do_node_verification(FIRM_VERIFICATION_OFF);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
......
......@@ -1457,9 +1457,6 @@ static int check_dominance_for_node(const ir_node *use)
int irn_verify_irg(const ir_node *n, ir_graph *irg)
{
if (!get_node_verification_mode())
return 1;
/*
* do NOT check placement in interprocedural view, as we don't always
* know the "right" graph ...
......@@ -1732,15 +1729,6 @@ int irg_verify(ir_graph *irg, unsigned flags)
&res
);
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT && !res) {
ir_entity *ent = get_irg_entity(irg);
if (ent)
fprintf(stderr, "irg_verify: Verifying graph %s failed\n", get_entity_name(ent));
else
fprintf(stderr, "irg_verify: Verifying graph %p failed\n", (void *)irg);
}
#else
(void)irg;
(void)flags;
......@@ -1752,15 +1740,11 @@ int irg_verify(ir_graph *irg, unsigned flags)
int irn_verify_irg_dump(const ir_node *n, ir_graph *irg,
const char **bad_string)
{
firm_verification_t old = get_node_verification_mode();
firm_verify_failure_msg = NULL;
do_node_verification(FIRM_VERIFICATION_ERROR_ONLY);
int res = irn_verify_irg(n, irg);
if (res && irg_has_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE) &&
get_irg_pinned(irg) == op_pin_state_pinned)
res = check_dominance_for_node(n);
do_node_verification(old);
*bad_string = firm_verify_failure_msg;
return res;
......@@ -1789,12 +1773,8 @@ static void check_bads(ir_node *node, void *env)
if (is_Bad(pred)) {
venv->res |= BAD_CF;
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT) {
fprintf(stderr, "irg_verify_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
}
fprintf(stderr, "irg_verify_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
dump_ir_graph(irg, "assert");
}
}
}
......@@ -1805,12 +1785,8 @@ static void check_bads(ir_node *node, void *env)
if (is_Bad(get_nodes_block(node))) {
venv->res |= BAD_BLOCK;
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT) {
fprintf(stderr, "irg_verify_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
}
fprintf(stderr, "irg_verify_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
dump_ir_graph(irg, "assert");
}
}
......@@ -1818,12 +1794,8 @@ static void check_bads(ir_node *node, void *env)
if (is_Tuple(node)) {
venv->res |= TUPLE;
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT) {
fprintf(stderr, "irg_verify_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
}
fprintf(stderr, "irg_verify_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
dump_ir_graph(irg, "assert");
}
}
......@@ -1838,12 +1810,8 @@ static void check_bads(ir_node *node, void *env)
else {
venv->res |= BAD_CF;
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT) {
fprintf(stderr, "irg_verify_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
}
fprintf(stderr, "irg_verify_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
dump_ir_graph(irg, "assert");
}
}
......@@ -1851,12 +1819,8 @@ static void check_bads(ir_node *node, void *env)
if ((venv->flags & BAD_DF) == 0) {
venv->res |= BAD_DF;
if (get_node_verification_mode() == FIRM_VERIFICATION_REPORT) {
fprintf(stderr, "irg_verify_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
}
fprintf(stderr, "irg_verify_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
dump_ir_graph(irg, "assert");
}
}
}
......
......@@ -21,13 +21,10 @@ extern const char *firm_verify_failure_msg;
#define ASSERT_AND_RET(expr, string, ret) \
do { \
if (opt_do_node_verification == FIRM_VERIFICATION_ON) {\
if (!(expr) && current_ir_graph != get_const_code_irg()) \
dump_ir_graph(current_ir_graph, "assert"); \
assert((expr) && string); } \
if (!(expr) && current_ir_graph != get_const_code_irg()) \
dump_ir_graph(current_ir_graph, "assert"); \
assert((expr) && string); \
if (!(expr)) { \
if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
fprintf(stderr, #expr " : " string "\n"); \
firm_verify_failure_msg = #expr " && " string; \
return (ret); \
} \
......@@ -37,14 +34,10 @@ do { \
do { \
if (!(expr)) { \
firm_verify_failure_msg = #expr " && " string; \
if (opt_do_node_verification != FIRM_VERIFICATION_ERROR_ONLY) { blk } \
if (opt_do_node_verification == FIRM_VERIFICATION_REPORT) \
fprintf(stderr, #expr " : " string "\n"); \
else if (opt_do_node_verification == FIRM_VERIFICATION_ON) { \
if (!(expr) && current_ir_graph != get_const_code_irg()) \
dump_ir_graph(current_ir_graph, "assert"); \
assert((expr) && string); \
} \
blk \
if (!(expr) && current_ir_graph != get_const_code_irg()) \
dump_ir_graph(current_ir_graph, "assert"); \
assert((expr) && string); \
return (ret); \
} \
} while(0)
......
Markdown is supported
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