Commit 3882b249 authored by Matthias Braun's avatar Matthias Braun
Browse files

replace assert(0 && "message") with panic("message")

also removed some assert(0) used in verifiers to stop when compiling
with assertions (you better use your debugger to stop and keep the code
clean)
parent 3b9811c4
......@@ -446,7 +446,7 @@ static ir_node *find_tail(ir_node *n)
}
if (m == n) break; /* It's not an unreachable loop, either. */
}
//assert(0 && "no head found on stack");
//panic("no head found on stack");
}
}
assert(res_index > -2);
......
......@@ -518,7 +518,7 @@ static ir_node *find_tail(ir_node *n)
if (m == n)
break;
}
//assert(0 && "no head found on stack");
//panic("no head found on stack");
}
}
......
......@@ -484,7 +484,7 @@ static void co_collect_units(ir_node *irn, void *env)
}
}
} else {
assert(0 && "This is not an optimizable node!");
panic("This is not an optimizable node!");
}
/* Insert the new unit at a position according to its costs */
......
......@@ -93,7 +93,6 @@ static void verify_liveness_walker(ir_node *block, void *data)
irn, block, get_irg_name(env->irg), pressure, env->registers_available);
print_living_values(stderr, &live_nodes);
env->problem_found = true;
assert(0);
}
}
ir_nodeset_destroy(&live_nodes);
......
......@@ -182,7 +182,6 @@ static inline void verify_list_head(ir_node *irn, ir_edge_kind_t kind)
fprintf(stderr, "- at list entry %d\n", num);
if (edge->src)
ir_fprintf(stderr, "- edge(%ld) %+F(%d)\n", edge_get_id(edge), edge->src, edge->pos);
assert(0 && "No source node found");
break;
}
num++;
......
......@@ -1847,7 +1847,6 @@ static void check_bads(ir_node *node, void *env)
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
assert(0 && "Bad CF detected");
}
}
}
......@@ -1864,7 +1863,6 @@ static void check_bads(ir_node *node, void *env)
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
assert(0 && "Bad CF detected");
}
}
}
......@@ -1878,7 +1876,6 @@ static void check_bads(ir_node *node, void *env)
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
assert(0 && "Tuple detected");
}
}
}
......@@ -1899,7 +1896,6 @@ static void check_bads(ir_node *node, void *env)
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
assert(0 && "Bad CF detected");
}
}
}
......@@ -1913,7 +1909,6 @@ static void check_bads(ir_node *node, void *env)
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
dump_ir_graph(irg, "assert");
assert(0 && "Bad NON-CF detected");
}
}
}
......
......@@ -388,7 +388,7 @@ static void lower_Load(ir_node *node, ir_mode *mode)
break;
}
default:
assert(0 && "unexpected Proj number");
panic("unexpected Proj number");
}
/* mark this proj: we have handled it already, otherwise we might fall
* into out new nodes. */
......@@ -453,7 +453,7 @@ static void lower_Store(ir_node *node, ir_mode *mode)
set_Proj_pred(proj, low);
break;
default:
assert(0 && "unexpected Proj number");
panic("unexpected Proj number");
}
/* mark this proj: we have handled it already, otherwise we might fall into
* out new nodes. */
......@@ -561,7 +561,7 @@ static void lower_Div(ir_node *node, ir_mode *mode)
}
break;
default:
assert(0 && "unexpected Proj number");
panic("unexpected Proj number");
}
/* mark this proj: we have handled it already, otherwise we might fall into
* out new nodes. */
......@@ -633,7 +633,7 @@ static void lower_Mod(ir_node *node, ir_mode *mode)
}
break;
default:
assert(0 && "unexpected Proj number");
panic("unexpected Proj number");
}
/* mark this proj: we have handled it already, otherwise we might fall
* into out new nodes. */
......
......@@ -200,9 +200,7 @@ static ir_type *get_softfloat_type(const ir_node *n)
default: break;
}
assert(0 && "Could not determine a suitable type");
return NULL;
panic("Could not determine a suitable type");
}
/**
......@@ -722,7 +720,7 @@ static void lower_Div(ir_node *n)
exchange(proj, call_result);
break;
default:
assert(0 && "unexpected Proj number");
panic("unexpected Proj number");
}
}
......
......@@ -17,6 +17,7 @@
#include "debug.h"
#include "set.h"
#include "debug.h"
#include "error.h"
#include "sp_matrix.h"
#include "mps.h"
......@@ -364,7 +365,7 @@ void lpp_check_startvals(lpp_t *lpp)
}
break;
default:
assert(0 && "unknown constraint type");
panic("unknown constraint type");
}
next: ;
}
......
......@@ -39,7 +39,6 @@ static void chk_cpx_err(cpx_t *cpx)
printf("%s", cpx->buf);
else
printf("Unknown CPLEX error\n");
assert(0);
}
}
......
......@@ -10,6 +10,7 @@
#include <stdarg.h>
#include <assert.h>
#include "mps.h"
#include "error.h"
/**
* These must comply to the enum cst_t in lpp.h
......@@ -48,7 +49,7 @@ static void mps_write_line(FILE *out, lpp_mps_style_t style,
case l_data_col2: fmt = " %-8s %-8s %12g %-8s %12g\n"; break; /* Field 2-6 */
case l_data_mst: fmt = " %-8s %12g\n"; break; /* Field 3-4 */
case l_marker: fmt = " M%-7d 'MARKER' '%s'\n"; break; /* Field 2,3,5 */
default: assert(0);
default: panic("invalid line type");
}
} else {
switch (line_type) {
......@@ -64,7 +65,7 @@ static void mps_write_line(FILE *out, lpp_mps_style_t style,
case l_data_col2: fmt = " %s\t%s\t%g\t%s\t%g\n"; break;
case l_data_mst: fmt = " %s\t%g\n"; break;
case l_marker: fmt = " M%d\t'MARKER'\t'%s'\n"; break;
default: assert(0);
default: panic("invalid line type");
}
}
......
......@@ -1864,7 +1864,7 @@ static void do_dfs(ir_graph *irg, loop_env *env)
} else if (is_Bad(pred)) {
/* ignore non-optimized block predecessor */
} else {
assert(0 && "Unknown EndBlock predecessor");
panic("Unknown EndBlock predecessor");
}
}
......
......@@ -201,10 +201,11 @@ ir_mode *(get_type_mode)(const ir_type *tp)
void set_type_mode(ir_type *tp, ir_mode *mode)
{
const tp_op *tpop = get_type_tpop(tp);
if (tpop->ops.set_type_mode)
if (tpop->ops.set_type_mode) {
tpop->ops.set_type_mode(tp, mode);
else
assert(0 && "setting a mode is NOT allowed for this type");
} else {
panic("setting a mode is NOT allowed for this type");
}
}
long get_type_nr(const ir_type *tp)
......
......@@ -183,8 +183,7 @@ static void do_type_walk(type_or_ent tore,
/* a leave. */
break;
case tpo_uninitialized:
assert(0 && "Faulty type");
break;
panic("Faulty type");
}
break; /* end case k_type */
......
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