Commit 9e56dbf0 authored by Matthias Braun's avatar Matthias Braun
Browse files

fixed warnings

[r14604]
parent 352ef959
......@@ -395,7 +395,7 @@ static void *TEMPLATE_init(FILE *outfile) {
be_emit_init_env(&isa->emit, outfile);
TEMPLATE_register_init(isa);
TEMPLATE_register_init();
TEMPLATE_create_opcodes();
return isa;
......@@ -418,11 +418,16 @@ static void TEMPLATE_done(void *self) {
static int TEMPLATE_get_n_reg_class(const void *self) {
static int TEMPLATE_get_n_reg_class(const void *self)
{
(void) self;
return N_CLASSES;
}
static const arch_register_class_t *TEMPLATE_get_reg_class(const void *self, int i) {
static const arch_register_class_t *TEMPLATE_get_reg_class(const void *self,
int i)
{
(void) self;
assert(i >= 0 && i < N_CLASSES && "Invalid TEMPLATE register class requested.");
return &TEMPLATE_reg_classes[i];
}
......@@ -435,7 +440,10 @@ static const arch_register_class_t *TEMPLATE_get_reg_class(const void *self, int
* @param mode The mode in question.
* @return A register class which can hold values of the given mode.
*/
const arch_register_class_t *TEMPLATE_get_reg_class_for_mode(const void *self, const ir_mode *mode) {
const arch_register_class_t *TEMPLATE_get_reg_class_for_mode(const void *self,
const ir_mode *mode)
{
(void) self;
if (mode_is_float(mode))
return &TEMPLATE_reg_classes[CLASS_TEMPLATE_floating_point];
else
......@@ -467,10 +475,11 @@ static void *TEMPLATE_abi_init(const be_abi_call_t *call, const arch_env_t *arch
* @param self The callback object.
* @return The between type of for that call.
*/
static ir_type *TEMPLATE_get_between_type(void *self) {
//TEMPLATE_abi_env_t *env = self;
static ir_type *TEMPLATE_get_between_type(void *self)
{
static ir_type *between_type = NULL;
static ir_entity *old_bp_ent = NULL;
static ir_entity *old_bp_ent = NULL;
(void) self;
if(!between_type) {
ir_entity *ret_addr_ent;
......@@ -501,8 +510,12 @@ static void TEMPLATE_abi_dont_save_regs(void *self, pset *s)
/**
* Build the prolog, return the BASE POINTER register
*/
static const arch_register_t *TEMPLATE_abi_prologue(void *self, ir_node **mem, pmap *reg_map) {
static const arch_register_t *TEMPLATE_abi_prologue(void *self, ir_node **mem,
pmap *reg_map)
{
TEMPLATE_abi_env_t *env = self;
(void) reg_map;
(void) mem;
if(env->flags.try_omit_fp)
return env->isa->sp;
......@@ -510,8 +523,13 @@ static const arch_register_t *TEMPLATE_abi_prologue(void *self, ir_node **mem, p
}
/* Build the epilog */
static void TEMPLATE_abi_epilogue(void *self, ir_node *bl, ir_node **mem, pmap *reg_map) {
//TEMPLATE_abi_env_t *env = self;
static void TEMPLATE_abi_epilogue(void *self, ir_node *bl, ir_node **mem,
pmap *reg_map)
{
(void) self;
(void) bl;
(void) mem;
(void) reg_map;
}
static const be_abi_callbacks_t TEMPLATE_abi_callbacks = {
......@@ -529,11 +547,14 @@ static const be_abi_callbacks_t TEMPLATE_abi_callbacks = {
* @param method_type The type of the method (procedure) in question.
* @param abi The abi object to be modified
*/
void TEMPLATE_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi) {
void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
be_abi_call_t *abi)
{
ir_type *tp;
ir_mode *mode;
int i, n = get_method_n_params(method_type);
be_abi_call_flags_t call_flags;
(void) self;
/* set abi flags for calls */
call_flags.bits.left_to_right = 0;
......@@ -565,7 +586,11 @@ void TEMPLATE_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t
}
}
static const void *TEMPLATE_get_irn_ops(const arch_irn_handler_t *self, const ir_node *irn) {
static const void *TEMPLATE_get_irn_ops(const arch_irn_handler_t *self,
const ir_node *irn)
{
(void) self;
(void) irn;
return &TEMPLATE_irn_ops;
}
......@@ -573,11 +598,16 @@ const arch_irn_handler_t TEMPLATE_irn_handler = {
TEMPLATE_get_irn_ops
};
const arch_irn_handler_t *TEMPLATE_get_irn_handler(const void *self) {
const arch_irn_handler_t *TEMPLATE_get_irn_handler(const void *self)
{
(void) self;
return &TEMPLATE_irn_handler;
}
int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn) {
int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn)
{
(void) block_env;
if(!is_TEMPLATE_irn(irn))
return -1;
......@@ -587,7 +617,10 @@ int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn) {
/**
* Initializes the code generator interface.
*/
static const arch_code_generator_if_t *TEMPLATE_get_code_generator_if(void *self) {
static const arch_code_generator_if_t *TEMPLATE_get_code_generator_if(
void *self)
{
(void) self;
return &TEMPLATE_code_gen_if;
}
......@@ -596,7 +629,10 @@ list_sched_selector_t TEMPLATE_sched_selector;
/**
* Returns the reg_pressure scheduler with to_appear_in_schedule() overloaded
*/
static const list_sched_selector_t *TEMPLATE_get_list_sched_selector(const void *self, list_sched_selector_t *selector) {
static const list_sched_selector_t *TEMPLATE_get_list_sched_selector(
const void *self, list_sched_selector_t *selector)
{
(void) self;
memcpy(&TEMPLATE_sched_selector, trivial_selector, sizeof(list_sched_selector_t));
TEMPLATE_sched_selector.to_appear_in_schedule = TEMPLATE_to_appear_in_schedule;
return &TEMPLATE_sched_selector;
......
......@@ -86,9 +86,11 @@ static set *cur_reg_set = NULL;
*/
static const
arch_register_req_t *arm_get_irn_reg_req(const void *self, const ir_node *node,
int pos) {
int pos)
{
long node_pos = pos == -1 ? 0 : pos;
ir_mode *mode = get_irn_mode(node);
(void) self;
if (is_Block(node) || mode == mode_X || mode == mode_M) {
return arch_no_register_req;
......@@ -126,8 +128,11 @@ arch_register_req_t *arm_get_irn_reg_req(const void *self, const ir_node *node,
return arch_no_register_req;
}
static void arm_set_irn_reg(const void *self, ir_node *irn, const arch_register_t *reg) {
static void arm_set_irn_reg(const void *self, ir_node *irn,
const arch_register_t *reg)
{
int pos = 0;
(void) self;
if (get_irn_mode(irn) == mode_X) {
return;
......@@ -150,9 +155,12 @@ static void arm_set_irn_reg(const void *self, ir_node *irn, const arch_register_
}
}
static const arch_register_t *arm_get_irn_reg(const void *self, const ir_node *irn) {
static const arch_register_t *arm_get_irn_reg(const void *self,
const ir_node *irn)
{
int pos = 0;
const arch_register_t *reg = NULL;
(void) self;
if (is_Proj(irn)) {
......@@ -176,7 +184,9 @@ static const arch_register_t *arm_get_irn_reg(const void *self, const ir_node *i
return reg;
}
static arch_irn_class_t arm_classify(const void *self, const ir_node *irn) {
static arch_irn_class_t arm_classify(const void *self, const ir_node *irn)
{
(void) self;
irn = skip_Proj_const(irn);
if (is_cfop(irn)) {
......@@ -189,7 +199,9 @@ static arch_irn_class_t arm_classify(const void *self, const ir_node *irn) {
return 0;
}
static arch_irn_flags_t arm_get_flags(const void *self, const ir_node *irn) {
static arch_irn_flags_t arm_get_flags(const void *self, const ir_node *irn)
{
(void) self;
irn = skip_Proj_const(irn);
if (is_arm_irn(irn)) {
......@@ -202,7 +214,10 @@ static arch_irn_flags_t arm_get_flags(const void *self, const ir_node *irn) {
return 0;
}
static ir_entity *arm_get_frame_entity(const void *self, const ir_node *irn) {
static ir_entity *arm_get_frame_entity(const void *self, const ir_node *irn)
{
(void) self;
(void) irn;
/* TODO: return the entity assigned to the frame */
return NULL;
}
......@@ -219,7 +234,10 @@ static void arm_set_stack_bias(const void *self, ir_node *irn, int bias) {
/* TODO: correct offset if irn accesses the stack */
}
static int arm_get_sp_bias(const void *self, const ir_node *irn) {
static int arm_get_sp_bias(const void *self, const ir_node *irn)
{
(void) self;
(void) irn;
return 0;
}
......@@ -285,7 +303,9 @@ static void arm_prepare_graph(void *self) {
/**
* Called immediately before emit phase.
*/
static void arm_finish_irg(void *self) {
static void arm_finish_irg(void *self)
{
(void) self;
/* TODO: - fix offsets for nodes accessing stack
- ...
*/
......@@ -295,11 +315,15 @@ static void arm_finish_irg(void *self) {
/**
* These are some hooks which must be filled but are probably not needed.
*/
static void arm_before_sched(void *self) {
static void arm_before_sched(void *self)
{
(void) self;
/* Some stuff you need to do after scheduling but before register allocation */
}
static void arm_before_ra(void *self) {
static void arm_before_ra(void *self)
{
(void) self;
/* Some stuff you need to do immediately after register allocation */
}
......@@ -307,7 +331,8 @@ static void arm_before_ra(void *self) {
* We transform Spill and Reload here. This needs to be done before
* stack biasing otherwise we would miss the corrected offset for these nodes.
*/
static void arm_after_ra(void *self) {
static void arm_after_ra(void *self)
{
arm_code_gen_t *cg = self;
be_coalesce_spillslots(cg->birg);
}
......@@ -382,7 +407,10 @@ static ir_node *convert_dbl_to_int(ir_node *bl, ir_node *arg, ir_node *mem,
* 1.) A constant: simply move
* 2.) A load: simply load
*/
static ir_node *convert_sng_to_int(ir_node *bl, ir_node *arg) {
static ir_node *convert_sng_to_int(ir_node *bl, ir_node *arg)
{
(void) bl;
if (is_Const(arg)) {
tarval *tv = get_Const_tarval(arg);
unsigned v;
......@@ -737,7 +765,7 @@ static void *arm_init(FILE *file_handle) {
isa = xmalloc(sizeof(*isa));
memcpy(isa, &arm_isa_template, sizeof(*isa));
arm_register_init(isa);
arm_register_init();
isa->cg = NULL;
be_emit_init_env(&isa->emit, file_handle);
......
......@@ -205,9 +205,11 @@ int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn, int pos
return req->cls->n_regs;
}
void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls, bitset_t *bs)
void arch_put_non_ignore_regs(const arch_env_t *env,
const arch_register_class_t *cls, bitset_t *bs)
{
int i;
(void) env;
for(i = 0; i < cls->n_regs; ++i) {
if(!arch_register_type_is(&cls->regs[i], ignore))
......@@ -215,10 +217,12 @@ void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t
}
}
int arch_count_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls)
int arch_count_non_ignore_regs(const arch_env_t *env,
const arch_register_class_t *cls)
{
int i;
int result = 0;
(void) env;
for(i = 0; i < cls->n_regs; ++i) {
if(!arch_register_type_is(&cls->regs[i], ignore))
......
......@@ -501,7 +501,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i
int *assignment;
pmap *partners;
int i, n_alloc;
long col;
bitset_pos_t col;
const ir_edge_t *edge;
ir_node *perm = NULL;
int match_res, cost;
......
......@@ -102,6 +102,8 @@ static INLINE int nodes_interfere(const be_chordal_env_t *env, const ir_node *a,
static int set_cmp_conflict_t(const void *x, const void *y, size_t size) {
const conflict_t *xx = x;
const conflict_t *yy = y;
(void) size;
return ! (xx->n1 == yy->n1 && xx->n2 == yy->n2);
}
......@@ -143,6 +145,7 @@ static INLINE int qnode_are_conflicting(const qnode_t *qn, const ir_node *n1, co
}
static int set_cmp_node_stat_t(const void *x, const void *y, size_t size) {
(void) size;
return ((node_stat_t *)x)->irn != ((node_stat_t *)y)->irn;
}
......@@ -386,7 +389,8 @@ static INLINE void qnode_max_ind_set(qnode_t *qn, const unit_t *ou) {
ir_node **safe, **unsafe;
int i, o, safe_count, safe_costs, unsafe_count, *unsafe_costs;
bitset_t *curr, *best;
int max, next, pos, curr_weight, best_weight = 0;
bitset_pos_t pos;
int max, next, curr_weight, best_weight = 0;
/* assign the nodes into two groups.
* safe: node has no interference, hence it is in every max stable set.
......@@ -536,6 +540,7 @@ static void ou_optimize(unit_t *ou) {
qnode_t *curr = NULL, *tmp;
const arch_env_t *aenv = ou->co->aenv;
const arch_register_class_t *cls = ou->co->cls;
bitset_pos_t idx;
bitset_t *pos_regs = bitset_alloca(cls->n_regs);
DBG((dbg, LEVEL_1, "\tOptimizing unit:\n"));
......@@ -553,8 +558,8 @@ static void ou_optimize(unit_t *ou) {
assert(bitset_popcnt(pos_regs) != 0 && "No register is allowed for this node !!?");
/* create new qnode */
bitset_foreach(pos_regs, i)
ou_insert_qnode(ou, new_qnode(ou, i));
bitset_foreach(pos_regs, idx)
ou_insert_qnode(ou, new_qnode(ou, idx));
/* search best */
while (!list_empty(&ou->queue)) {
......
......@@ -702,7 +702,7 @@ static int coalesce_top_down(co2_cloud_irn_t *ci, int child_nr, int depth)
co2_t *env = ci->cloud->env;
col_cost_pair_t *seq = alloca(env->n_regs * sizeof(seq[0]));
int is_root = ci->mst_parent == ci;
col_t parent_col = is_root ? -1 : get_col(env, ci->mst_parent->inh.irn);
col_t parent_col = is_root ? (col_t) -1 : get_col(env, ci->mst_parent->inh.irn);
int min_badness = INT_MAX;
int best_col_costs = INT_MAX;
int best_col = -1;
......@@ -1117,7 +1117,7 @@ static void writeback_colors(co2_t *env)
|_| |___/
*/
static const char *get_dot_color_name(int col)
static const char *get_dot_color_name(size_t col)
{
static const char *names[] = {
"blue",
......@@ -1153,7 +1153,7 @@ static const char *get_dot_color_name(int col)
"palevioletred"
};
return col < sizeof(names)/sizeof(names[0]) ? names[col] : "white";
return col < (sizeof(names)/sizeof(names[0])) ? names[col] : "white";
}
static const char *get_dot_shape_name(co2_t *env, co2_irn_t *ci)
......@@ -1175,6 +1175,7 @@ static const char *get_dot_shape_name(co2_t *env, co2_irn_t *ci)
static void ifg_dump_graph_attr(FILE *f, void *self)
{
(void) self;
fprintf(f, "overlay=false");
}
......
......@@ -769,7 +769,8 @@ static INLINE void reject_coloring(waitq *nodes) {
static void determine_color_costs(co_mst_env_t *env, co_mst_irn_t *node, col_cost_t *costs) {
affinity_node_t *an = get_affinity_info(env->co, node->irn);
neighb_t *aff_neigh;
int idx, i;
bitset_pos_t idx;
int i;
col_cost_init(env, costs, 0.0);
......
......@@ -64,7 +64,7 @@ static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_BOOL ("net", "solve over the net", &solve_net),
LC_OPT_ENT_BOOL ("log", "show ilp solving log", &solve_log),
LC_OPT_ENT_ENUM_MASK("dump", "dump flags", &dump_var),
{ NULL }
LC_OPT_ENT_NULL
};
void be_init_copyilp(void)
......
......@@ -39,7 +39,10 @@ typedef struct _my_env_t {
} my_env_t;
int co_solve_ilp1(copy_opt_t *co, double time_limit) {
int co_solve_ilp1(copy_opt_t *co, double time_limit)
{
(void) co;
(void) time_limit;
return 1;
}
......
......@@ -188,10 +188,12 @@ static INLINE int was_edge_critical(const ir_node *bl, int pos) {
/**
* Collect phi node data
*/
static void stat_phi_node(be_chordal_env_t *chordal_env, ir_node *phi) {
static void stat_phi_node(be_chordal_env_t *chordal_env, ir_node *phi)
{
int arity, i;
ir_node *phi_bl;
assert(is_Phi(phi));
(void) chordal_env;
/* count all phi phis */
curr_vals[I_PHI_CNT]++;
......
......@@ -42,6 +42,8 @@ typedef struct be_emit_env_t {
int linelength; /**< The length of the current line. */
} be_emit_env_t;
#define NULL_EMITTER { NULL, {}, 0 }
/**
* Emit a character to the (assembler) output.
*
......
......@@ -79,8 +79,8 @@ static const char *get_section_name(be_gas_section_t section) {
}
};
assert(be_gas_flavour >= 0 && be_gas_flavour < GAS_FLAVOUR_MAX);
assert(section >= 0 && section < GAS_SECTION_MAX);
assert((int) be_gas_flavour >= 0 && be_gas_flavour < GAS_FLAVOUR_MAX);
assert((int) section >= 0 && section < GAS_SECTION_MAX);
return text[be_gas_flavour][section];
}
......
......@@ -113,8 +113,7 @@ static void write_pointers(bitset_t *live, ifg_pointer_t *ifg)
ir_node *live_irn;
bitset_pos_t elm;
bitset_foreach_irn(ifg->env->irg, live, elm, live_irn)
{
bitset_foreach_irn(ifg->env->irg, live, elm, live_irn) {
ptr_head_t *head = phase_get_or_set_irn_data(&ifg->ph, live_irn);
ptr_head_t *element = ptr_get_new_head(ifg);
......@@ -605,12 +604,14 @@ static ir_node *ifg_pointer_neighbours_begin(const void *self, void *iter, const
static ir_node *ifg_pointer_neighbours_next(const void *self, void *iter)
{
(void) self;
return get_next_neighbour(iter);
}
static void ifg_pointer_neighbours_break(const void *self, void *iter)
{
ptr_iter_t *it = iter;
(void) self;
bitset_free(it->visited_neighbours);
......@@ -624,11 +625,14 @@ static ir_node *ifg_pointer_nodes_begin(const void *self, void *iter)
static ir_node *ifg_pointer_nodes_next(const void *self, void *iter)
{
(void) self;
return get_next_irn(iter);
}
static void ifg_pointer_nodes_break(const void *self, void *iter)
{
(void) self;
(void) iter;
return;
}
......
......@@ -63,7 +63,7 @@ static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_STR ("jvm", "absolute path to jvm dll", jvm_lib, sizeof(jvm_lib)),
LC_OPT_ENT_STR ("jar", "jar file of the coalescer", jar_file, sizeof(jar_file)),
LC_OPT_ENT_STR ("cls", "name of the class providing the factory", cls_name, sizeof(cls_name)),
{ NULL }
LC_OPT_ENT_NULL
};
void be_init_javacoal(void)
......@@ -131,6 +131,8 @@ static void *find_jvm_symbol(const char *vmlibpath, const char *sym)
static char *locate_jvm_lib(char *path, size_t n)
{
(void) path;
(void) n;
return NULL;
}
#endif /* _WIN32 */
......@@ -387,6 +389,9 @@ void be_java_coal_set_color(be_java_coal_t *c, int n, int col)
void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg)
{
(void) c;
(void) n;
(void) dbg;
#if 0
JNIEnv *jni = c->env->jni;
jmethodID mid = c->mth_ids[mth_set_debug];
......
......@@ -123,7 +123,7 @@ static lc_opt_enum_int_var_t sched_prep_var = {
static const lc_opt_table_entry_t list_sched_option_table[] = {
LC_OPT_ENT_ENUM_PTR("prep", "schedule preparation", &sched_prep_var),
LC_OPT_ENT_ENUM_PTR("select", "node selector", &sched_select_var),
{ NULL }
LC_OPT_ENT_NULL
};
/**
......@@ -567,6 +567,7 @@ void list_sched(const be_irg_t *birg, be_options_t *be_opts)
{
const arch_env_t *arch_env = birg->main_env->arch_env;
ir_graph *irg = birg->irg;
(void) be_opts;
int num_nodes;
sched_env_t env;
......@@ -644,10 +645,12 @@ void list_sched(const be_irg_t *birg, be_options_t *be_opts)
}
/* List schedule a block. */
void list_sched_single_block(const be_irg_t *birg, ir_node *block, be_options_t *be_opts)
void list_sched_single_block(const be_irg_t *birg, ir_node *block,
be_options_t *be_opts)
{
const arch_env_t *arch_env = birg->main_env->arch_env;
ir_graph *irg = birg->irg;
(void) be_opts;
int num_nodes;
sched_env_t env;
......
......@@ -475,6 +475,7 @@ static void *lv_phase_data_init(ir_phase *phase, ir_node *irn, void *old)
{
struct _be_lv_info_t *info = phase_alloc(phase, LV_STD_SIZE * sizeof(info[0]));
(void) irn;
(void) old;
memset(info, 0, LV_STD_SIZE * sizeof(info[0]));
info[0].u.head.n_size = LV_STD_SIZE - 1;
......@@ -541,6 +542,8 @@ void be_liveness_assure_chk(be_lv_t *lv)
{
#ifndef USE_LIVE_CHK
be_liveness_assure_sets(be_lv_t *lv);
#else
(void) lv;
#endif
}
......
......@@ -57,9 +57,10 @@ struct _be_loopana_t {
be_irg_t *birg;
};
static int cmp_loop_info(const void *a, const void *b, size_t sz) {
static int cmp_loop_info(const void *a, const void *b, size_t size) {
const be_loop_info_t *i1 = a;
const be_loop_info_t *i2 = b;
(void) size;
return ! (i1->loop == i2->loop && i1->cls == i2->cls);
}
......
......@@ -152,6 +152,8 @@ static int set_opt_module(const char *name, lc_opt_type_t type, void *data,
va_list args;
const char *opt;
const be_module_list_entry_t *module;
(void) type;
(void) name;
va_start(args, length);
opt = va_arg(args, const char*);
......@@ -176,6 +178,9 @@ int dump_opt_module(char *buf, size_t buflen, const char *name,
{
module_opt_data_t *moddata = data;
const be_module_list_entry_t *module;