Commit 1660476d authored by Christian Würdig's avatar Christian Würdig
Browse files

made code C89 compliant

removed some unused variables
code cleanup
parent cc18a73b
#
# Project: libFIRM
# File name: ir/be/ia32/Makefile.in
# File name: ir/be/arm/Makefile.in
# Purpose:
# Author: Boris Boesler, Till Riedel
# Modified by:
......
......@@ -61,10 +61,8 @@ int is_immediate_node(ir_node *irn) {
*/
static const char *node_const_to_str(ir_node *n) {
char buffer[SNPRINTF_BUF_LEN];
ir_mode *mode = get_irn_mode(n);
if ( is_immediate_node(n) ) {
tarval *tv = get_arm_value(n);
long longvalue = get_tarval_long(get_arm_value(n));
char *str;
assert(longvalue < 0x1000 && "constant doesn't fit in shifter_operand");
......@@ -385,9 +383,9 @@ static void emit_arm_CondJmp(ir_node *irn, void *env) {
}
if (proj_num == pn_Cmp_False) {
fprintf(out, "\tB BLOCK_%d\t\t\t/* false case */\n", get_irn_node_nr(false_block));
fprintf(out, "\tB BLOCK_%ld\t\t\t/* false case */\n", get_irn_node_nr(false_block));
} else if (proj_num == pn_Cmp_True) {
fprintf(out, "\tB BLOCK_%d\t\t\t/* true case */\n", get_irn_node_nr(true_block));
fprintf(out, "\tB BLOCK_%ld\t\t\t/* true case */\n", get_irn_node_nr(true_block));
} else {
if (mode_is_float(opmode)) {
suffix = "ICHWILLIMPLEMENTIERTWERDEN";
......@@ -549,7 +547,7 @@ static void emit_arm_SwitchJmp(ir_node *irn, void *env) {
} else {
block = get_irn_link(projs[get_arm_default_proj_num(irn)]);
}
fprintf(out, "\t.word\tBLOCK_%d\n",get_irn_node_nr(block));
fprintf(out, "\t.word\tBLOCK_%ld\n",get_irn_node_nr(block));
}
fprintf(out, "\t.align 2\n");
......@@ -683,7 +681,7 @@ static void emit_Jmp(ir_node *irn, void *env) {
FILE *out = emit_env->out;
const ir_edge_t *edge = get_irn_out_edge_first(irn);
ir_node *target_block = get_edge_src_irn(edge);
fprintf(out, "\tB BLOCK_%d\t\t\t/* unconditional Jump */\n", get_irn_node_nr(target_block));
fprintf(out, "\tB BLOCK_%ld\t\t\t/* unconditional Jump */\n", get_irn_node_nr(target_block));
}
static void emit_Proj(ir_node *irn, void *env) {
......@@ -803,7 +801,6 @@ void arm_emit_start(FILE *F, ir_graph *irg) {
* Emits code for function end
*/
void arm_emit_end(FILE *F, ir_graph *irg) {
const char *irg_name = get_entity_name(get_irg_entity(irg));
}
/**
......
......@@ -43,19 +43,15 @@ extern ir_op *get_op_Mulh(void);
*
****************************************************************************************************/
typedef struct vals_ {
int ops;
unsigned char values[4];
unsigned char shifts[4];
} vals;
static vals construct_vals() {
vals result = {0, {0, 0, 0, 0}, {0, 0, 0, 0}};
return result;
static vals construct_vals(void) {
vals result = { 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } };
return result;
}
static vals gen_vals_from_word(unsigned int value)
......@@ -78,9 +74,9 @@ static vals gen_vals_from_word(unsigned int value)
}
static ir_node *create_const_node(arm_transform_env_t *env, int value) {
ir_node *result = new_rd_arm_Const(env->dbg, env->irg, env->block, env->mode);
get_arm_attr(result)->value = new_tarval_from_long(value, env->mode);
return result;
ir_node *result = new_rd_arm_Const(env->dbg, env->irg, env->block, env->mode);
get_arm_attr(result)->value = new_tarval_from_long(value, env->mode);
return result;
}
#define NEW_BINOP_NODE(opname, env, op1, op2) new_rd_arm_##opname(env->dbg, env->irg, env->block, op1, op2, env->mode)
......@@ -695,13 +691,13 @@ static ir_node *gen_Store(arm_transform_env_t *env) {
static ir_node *gen_Cond(arm_transform_env_t *env) {
ir_node *result = NULL;
ir_node *result = NULL;
ir_node *selector = get_Cond_selector(env->irn);
ir_node *irn = env->irn;
ir_node *irn = env->irn;
if ( get_irn_mode(selector) == mode_b ) {
//CondJmp
ir_node *proj_node = get_Cond_selector(irn);
ir_mode *proj_mode = get_irn_mode(proj_node);
ir_node *cmp_node = get_Proj_pred(proj_node);
ir_node *op1 = get_Cmp_left(cmp_node);
ir_node *op2 = get_Cmp_right(cmp_node);
......@@ -923,18 +919,22 @@ void arm_move_consts(ir_node *node, void *env) {
/* move symbolic constants out of startblock */
/************************************************************************/
void arm_move_symconsts(ir_node *node, void *env) {
arm_code_gen_t *cgenv = (arm_code_gen_t *)env;
int i;
if (is_Block(node))
return;
for (i=0; i<get_irn_arity(node); i++) {
ir_node *pred = get_irn_n(node,i);
opcode pred_code = get_irn_opcode(pred);
for (i = 0; i < get_irn_arity(node); i++) {
ir_node *pred = get_irn_n(node,i);
opcode pred_code = get_irn_opcode(pred);
if (pred_code == iro_SymConst) {
const char *str = get_sc_name(pred);
ir_node *symconst_node;
ir_node *symconst_node;
symconst_node = new_rd_arm_SymConst(get_irn_dbg_info(pred),
current_ir_graph, get_nodes_block(node), get_irn_mode(pred));
set_arm_symconst_label(symconst_node, str);
set_irn_n(node, i, symconst_node);
}
......
......@@ -535,7 +535,7 @@ void arm_global_init(void) {
map_Div->kind = INTRINSIC_INSTR;
map_Div->op = op_Div;
map_Div->i_mapper = i_mapper_RuntimeCall;
map_Div->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
map_Div->ctx = &rt_Div;
}
{
......@@ -558,7 +558,7 @@ void arm_global_init(void) {
map_Div->kind = INTRINSIC_INSTR;
map_Div->op = op_Div;
map_Div->i_mapper = i_mapper_RuntimeCall;
map_Div->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
map_Div->ctx = &rt_Div;
}
{
......@@ -581,7 +581,7 @@ void arm_global_init(void) {
map_Mod->kind = INTRINSIC_INSTR;
map_Mod->op = op_Mod;
map_Mod->i_mapper = i_mapper_RuntimeCall;
map_Mod->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
map_Mod->ctx = &rt_Mod;
}
{
......@@ -604,7 +604,7 @@ void arm_global_init(void) {
map_Mod->kind = INTRINSIC_INSTR;
map_Mod->op = op_Mod;
map_Mod->i_mapper = i_mapper_RuntimeCall;
map_Mod->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
map_Mod->ctx = &rt_Mod;
}
......@@ -887,13 +887,14 @@ void arm_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi
ir_mode *mode;
int i;
int n = get_method_n_params(method_type);
// const arch_register_t *reg;
be_abi_call_flags_t flags = {
0, /* store from left to right */
0, /* store arguments sequential */
1, /* try to omit the frame pointer */
1, /* the function can use any register as frame pointer */
1 /* a call can take the callee's address as an immediate */
{
0, /* store from left to right */
0, /* store arguments sequential */
1, /* try to omit the frame pointer */
1, /* the function can use any register as frame pointer */
1 /* a call can take the callee's address as an immediate */
}
};
/* set stack parameter passing style */
......
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