Commit d582c836 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

debug: Clean up panic messages.

* No \n at end; panic() adds one
* No punctuation mark at end
* Lowercase first letter
parent c2da6631
......@@ -125,7 +125,7 @@ void hungarian_prepare_cost_matrix(hungarian_problem_t *p,
} else if (mode == HUNGARIAN_MODE_MINIMIZE_COST) {
/* nothing to do */
} else {
panic("Unknown hungarian problem mode");
panic("unknown hungarian problem mode");
}
}
......
......@@ -115,7 +115,7 @@ void *pqueue_pop_front(pqueue_t *q)
{
switch (ARR_LEN(q->elems)) {
case 0:
panic("Attempt to retrieve element from empty priority queue.");
panic("attempt to retrieve element from empty priority queue");
case 1:
ARR_SHRINKLEN(q->elems, 0);
return q->elems[0].data;
......
......@@ -514,7 +514,7 @@ void ir_estimate_execfreq(ir_graph *irg)
continue;
for (int x = 0; x < size; x++) {
if (getm(in_fac, x, y) != 0)
panic("Expect entry at (%d, %d) to be 0.\n", x, y);
panic("expect entry at (%d, %d) to be 0", x, y);
}
}
#endif
......
......@@ -46,7 +46,7 @@ const char *get_ir_alias_relation_name(ir_alias_relation rel)
X(ir_sure_alias);
}
#undef X
panic("UNKNOWN alias relation");
panic("unknown alias relation");
}
unsigned get_irg_memory_disambiguator_options(const ir_graph *irg)
......
......@@ -255,7 +255,7 @@ static ir_node *gen_Proj_Start(ir_node *node)
case pn_Start_P_frame_base:
return new_rd_Proj(dbgi, new_start, gp_regs_mode, pn_TEMPLATE_Start_stack);
}
panic("unexpected Start proj %u\n", pn);
panic("unexpected Start proj %u", pn);
}
static ir_node *gen_Proj(ir_node *node)
......@@ -264,7 +264,7 @@ static ir_node *gen_Proj(ir_node *node)
switch (get_irn_opcode(pred)) {
case iro_Start: return gen_Proj_Start(node);
default:
panic("code selection can't handle Proj after %+F\n", pred);
panic("code selection can't handle Proj after %+F", pred);
}
}
......
......@@ -194,7 +194,7 @@ static ir_node *TEMPLATE_new_spill(ir_node *value, ir_node *after)
{
(void)value;
(void)after;
panic("TEMPLATE: spilling not implemented yet");
panic("spilling not implemented yet");
}
static ir_node *TEMPLATE_new_reload(ir_node *value, ir_node *spill,
......@@ -203,7 +203,7 @@ static ir_node *TEMPLATE_new_reload(ir_node *value, ir_node *spill,
(void)value;
(void)spill;
(void)before;
panic("TEMPLATE: reload not implemented yet");
panic("reload not implemented yet");
}
const arch_isa_if_t TEMPLATE_isa_if = {
......
......@@ -175,12 +175,12 @@ x86_cconv_t *amd64_decide_calling_convention(ir_type *function_type,
const arch_register_t *reg;
if (mode_is_float(result_mode)) {
if (res_float_regnum >= n_float_result_regs) {
panic("Too many floating points results");
panic("too many floating points results");
}
reg = float_result_regs[res_float_regnum++];
} else {
if (res_regnum >= n_result_regs) {
panic("Too many results");
panic("too many results");
}
reg = result_regs[res_regnum++];
}
......
......@@ -205,7 +205,7 @@ static void assure_should_be_same_requirements(ir_node *const node)
const arch_register_t *reg = arch_get_irn_register_in(node, i2);
if (reg == out_reg && (unsigned)i2 != same_pos) {
if (!is_amd64_irn(node))
panic("Cannot fulfill should_be_same on non-amd64 node");
panic("cannot fulfill should_be_same on non-amd64 node");
/* see what role this register has */
const amd64_attr_t *attr = get_amd64_attr_const(node);
if (attr->op_mode == AMD64_OP_ADDR
......
......@@ -1443,7 +1443,7 @@ static ir_node *gen_Proj_Start(ir_node *node)
case pn_Start_P_frame_base:
return get_frame_base(irg);
}
panic("Unexpected Start Proj: %u\n", pn);
panic("unexpected Start Proj: %u", pn);
}
static ir_node *get_stack_pointer_for(ir_node *node)
......@@ -1782,7 +1782,7 @@ static ir_node *gen_Proj_Call(ir_node *node)
case pn_Call_T_result:
break;
}
panic("Unexpected Call proj %+F\n", node);
panic("unexpected Call proj %+F", node);
}
static ir_node *gen_Proj_Proj_Call(ir_node *node)
......@@ -2037,7 +2037,7 @@ static ir_node *gen_Conv(ir_node *node)
/* The conversion is signed only; simply use 64-bit register*/
insn_mode = INSN_MODE_64;
} else if (!mode_is_signed(dst_mode) && dst_bits == 64) {
panic("Cannot convert floating point to 64-bit unsigned\n");
panic("cannot convert floating point to 64-bit unsigned");
}
if (src_bits < 64) {
......@@ -2071,7 +2071,7 @@ static ir_node *gen_Conv(ir_node *node)
in[0] = new_r_Proj(ext, mode_gp, pn_amd64_Mov_res);
} else if (!mode_is_signed(src_mode) && src_bits == 64) {
panic("Cannot convert 64-bit unsigned to floating point\n");
panic("cannot convert 64-bit unsigned to floating point");
}
if (dst_bits < 64) {
......@@ -2150,7 +2150,7 @@ static ir_node *gen_Store(ir_node *node)
case 4: reqs = need_xmm ? xmm_reg_reg_mem_reqs : reg_reg_reg_mem_reqs;
break;
default:
panic("Unexpected arity %d while transforming node %+F", arity, node);
panic("unexpected arity %d while transforming node %+F", arity, node);
}
......@@ -2342,7 +2342,7 @@ static ir_node *gen_Proj_Load(ir_node *node)
assert(pn == pn_Load_M);
return new_r_Proj(new_load, mode_M, pn_amd64_mem);
default:
panic("Unsupported Proj from Load");
panic("unsupported Proj from Load");
}
return be_duplicate_node(node);
......@@ -2355,7 +2355,7 @@ static ir_node *gen_Proj_Store(ir_node *node)
if (pn == pn_Store_M) {
return be_transform_node(pred);
} else {
panic("Unsupported Proj from Store");
panic("unsupported Proj from Store");
}
}
......@@ -2492,7 +2492,7 @@ static ir_node *gen_Proj_Builtin(ir_node *proj)
static ir_node *gen_Bitcast(ir_node *node)
{
(void)node;
panic("Bitcast NIY\n");
panic("Bitcast NIY");
}
/* Boilerplate code for transformation: */
......
......@@ -116,18 +116,18 @@ calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
if (mode_is_float(result_mode)) {
if (float_regnum >= n_float_result_regs) {
panic("Too many float results");
panic("too many float results");
} else {
const arch_register_t *reg = float_result_regs[float_regnum++];
result->reg0 = reg;
}
} else {
if (get_mode_size_bits(result_mode) > 32) {
panic("Results with more than 32bits not supported yet");
panic("results with more than 32bits not supported yet");
}
if (regnum >= n_result_regs) {
panic("Too many results");
panic("too many results");
} else {
const arch_register_t *reg = result_regs[regnum++];
result->reg0 = reg;
......
......@@ -222,7 +222,7 @@ static void arm_emit_shifter_operand(const ir_node *node)
case ARM_SHF_INVALID:
break;
}
panic("Invalid shift_modifier while emitting %+F", node);
panic("invalid shift_modifier while emitting %+F", node);
}
/**
......
......@@ -365,7 +365,7 @@ static ir_entity *create_64_intrinsic_fkt(ir_type *method, const ir_op *op,
panic("can't lower 64bit Conv");
}
} else {
panic("Cannot lower unexpected 64bit operation %s", get_op_name(op));
panic("cannot lower unexpected 64bit operation %s", get_op_name(op));
}
ident *id = new_id_from_str(name);
ir_type *glob = get_glob_type();
......
......@@ -1500,7 +1500,7 @@ static ir_node *gen_Proj_Load(ir_node *node)
default:
break;
}
panic("Unsupported Proj from Load");
panic("unsupported Proj from Load");
}
static ir_node *gen_Proj_Div(ir_node *node)
......@@ -1520,7 +1520,7 @@ static ir_node *gen_Proj_Div(ir_node *node)
case pn_Div_X_except:
break;
}
panic("Unsupported Proj from Div");
panic("unsupported Proj from Div");
}
static ir_node *gen_Proj_Start(ir_node *node)
......@@ -1536,7 +1536,7 @@ static ir_node *gen_Proj_Start(ir_node *node)
case pn_Start_P_frame_base:
return be_get_start_proj(get_irn_irg(node), &start_sp);
}
panic("unexpected start proj: %u\n", pn);
panic("unexpected start proj: %u", pn);
}
static ir_node *gen_Proj_Proj_Start(ir_node *node)
......@@ -1656,7 +1656,7 @@ static ir_node *gen_Proj_Call(ir_node *node)
case pn_Call_T_result:
break;
}
panic("Unexpected Call proj %u\n", pn);
panic("unexpected Call proj %u", pn);
}
static ir_node *gen_Proj_Store(ir_node *node)
......@@ -1670,7 +1670,7 @@ static ir_node *gen_Proj_Store(ir_node *node)
case pn_Store_X_except:
break;
}
panic("Unsupported Proj from Store");
panic("unsupported Proj from Store");
}
static ir_node *gen_Proj_Proj(ir_node *node)
......@@ -1682,7 +1682,7 @@ static ir_node *gen_Proj_Proj(ir_node *node)
} else if (is_Start(pred_pred)) {
return gen_Proj_Proj_Start(node);
}
panic("code selection didn't expect Proj(Proj) after %+F\n", pred_pred);
panic("code selection didn't expect Proj(Proj) after %+F", pred_pred);
}
static ir_node *gen_Unknown(ir_node *node)
......@@ -1701,7 +1701,7 @@ static ir_node *gen_Unknown(ir_node *node)
return create_const_graph_value(dbgi, new_block, 0);
}
panic("Unexpected Unknown mode");
panic("unexpected Unknown mode");
}
/**
......
......@@ -145,7 +145,7 @@ static void remove_empty_block(ir_node *block)
set_irn_n(node, pos, succ_block);
continue;
}
panic("Unexpected node %+F in block %+F with empty schedule", node, block);
panic("unexpected node %+F in block %+F with empty schedule", node, block);
}
ir_graph *irg = get_irn_irg(block);
......
......@@ -224,7 +224,7 @@ lpp_sol_state_t ilp_go(ilp_env_t *ienv)
ienv->co->cenv->cls->name);
f = fopen(buf, "wt");
if (f == NULL) {
panic("Couldn't open '%s' for writing", buf);
panic("couldn't open '%s' for writing", buf);
}
lpp_dump_plain(ienv->lp, f);
fclose(f);
......
......@@ -545,7 +545,7 @@ static void ilp2_apply(ilp_env_t *ienv)
if (state != lpp_optimal) {
ir_printf("WARNING: Solution state of %F register class %s is not 'optimal': %d\n", ienv->co->irg, ienv->co->cls->name, (int)state);
if (state < lpp_feasible) {
panic("Copy coalescing solution not feasible!");
panic("copy coalescing solution not feasible");
}
}
......@@ -562,7 +562,7 @@ static void ilp2_apply(ilp_env_t *ienv)
ir_node *irn = get_idx_irn(irg, nodenr);
set_irn_col(ienv->co->cls, irn, color);
} else {
panic("This should be a x-var");
panic("this should be a x-var");
}
}
......
......@@ -456,7 +456,7 @@ static void co_collect_units(ir_node *irn, void *env)
}
}
} else {
panic("This is not an optimizable node!");
panic("this is not an optimizable node");
}
/* Insert the new unit at a position according to its costs */
......@@ -770,7 +770,7 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix,
free(tu_name);
FILE *result = fopen(buf, "wt");
if (result == NULL) {
panic("Couldn't open '%s' for writing.", buf);
panic("couldn't open '%s' for writing", buf);
}
return result;
......
......@@ -99,6 +99,6 @@ void be_emit_node(ir_node const *const node)
be_dwarf_location(get_irn_dbg_info(node));
ir_op *const op = get_irn_op(node);
emit_func *const emit = get_generic_function_ptr(emit_func, op);
DEBUG_ONLY(if (!emit) panic("no emit handler for node %+F (%+G, graph %+F)\n", node, node, get_irn_irg(node));)
DEBUG_ONLY(if (!emit) panic("no emit handler for node %+F (%+G, graph %+F)", node, node, get_irn_irg(node));)
emit(node);
}
......@@ -447,7 +447,7 @@ static be_gas_section_t determine_section(be_gas_decl_env_t *env,
return determine_basic_section(entity);
}
panic("Couldn't determine section for %+F?!?", entity);
panic("couldn't determine section for %+F", entity);
}
static void emit_weak(const ir_entity *entity)
......@@ -608,7 +608,7 @@ static void emit_arith_tarval(ir_tarval *tv, unsigned bytes)
return;
}
panic("Cannot dump a tarval with %d bytes", bytes);
panic("cannot dump a tarval with %d bytes", bytes);
}
/**
......@@ -665,7 +665,7 @@ static void emit_init_expression(be_gas_decl_env_t *env, ir_node *init)
case iro_Add:
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("Constant must be int or pointer for '+' to work");
panic("constant must be int or pointer for '+' to work");
}
emit_init_expression(env, get_Add_left(init));
be_emit_cstring(" + ");
......@@ -674,7 +674,7 @@ static void emit_init_expression(be_gas_decl_env_t *env, ir_node *init)
case iro_Sub:
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("Constant must be int or pointer for '-' to work");
panic("constant must be int or pointer for '-' to work");
}
emit_init_expression(env, get_Sub_left(init));
be_emit_cstring(" - ");
......@@ -683,7 +683,7 @@ static void emit_init_expression(be_gas_decl_env_t *env, ir_node *init)
case iro_Mul:
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("Constant must be int or pointer for '*' to work");
panic("constant must be int or pointer for '*' to work");
}
emit_init_expression(env, get_Mul_left(init));
be_emit_cstring(" * ");
......@@ -713,7 +713,7 @@ static void emit_size_type(size_t size)
case 8: be_emit_cstring("\t.quad\t"); break;
default:
panic("Try to dump a type with %u bytes", (unsigned)size);
panic("try to dump a type with %u bytes", (unsigned)size);
}
}
......@@ -865,7 +865,7 @@ static void emit_bitfield(normal_or_bitfield *vals, unsigned offset_bits,
panic("bitfield initializer is compound");
}
if (tv == NULL || tv == tarval_bad) {
panic("Couldn't get numeric value for bitfield initializer");
panic("couldn't get numeric value for bitfield initializer");
}
int value_len = get_type_size_bytes(type);
......
......@@ -512,7 +512,7 @@ static unsigned get_start_reg_index(ir_graph *irg, const arch_register_t *reg)
continue;
return i;
}
panic("Tried querying undefined register '%s' at Start", reg->name);
panic("tried querying undefined register '%s' at Start", reg->name);
}
ir_node *be_get_initial_reg_value(ir_graph *irg, const arch_register_t *reg)
......
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