Commit c79fe4ad authored by Matthias Braun's avatar Matthias Braun
Browse files

fix various warnings reported by cparser

[r27300]
parent 975ab11f
......@@ -754,7 +754,8 @@ static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops
CASE_PROJ(Quot);
CASE(Proj);
default:
/* leave NULL */;
/* leave NULL */
break;
}
return ops;
......@@ -1699,7 +1700,7 @@ static ir_node *equivalent_node_Proj_Bound(ir_node *proj)
break;
default:
/* cannot optimize pn_Bound_X_regular, handled in transform ... */
;
break;
}
}
return proj;
......@@ -1980,7 +1981,8 @@ static ir_op_ops *firm_set_default_equivalent_node(ir_opcode code, ir_op_ops *op
CASE(Mux);
CASE(Confirm);
default:
/* leave NULL */;
/* leave NULL */
break;
}
return ops;
......@@ -2279,6 +2281,7 @@ static ir_node *transform_node_AddSub(ir_node *n)
} /* transform_node_AddSub */
#define HANDLE_BINOP_PHI(eval, a, b, c, mode) \
do { \
c = NULL; \
if (is_Const(b) && is_const_Phi(a)) { \
/* check for Op(Phi, Const) */ \
......@@ -2295,9 +2298,11 @@ static ir_node *transform_node_AddSub(ir_node *n)
if (c) { \
DBG_OPT_ALGSIM0(oldn, c, FS_OPT_CONST_PHI); \
return c; \
}
} \
} while(0)
#define HANDLE_UNOP_PHI(eval, a, c) \
do { \
c = NULL; \
if (is_const_Phi(a)) { \
/* check for Op(Phi) */ \
......@@ -2306,7 +2311,8 @@ static ir_node *transform_node_AddSub(ir_node *n)
DBG_OPT_ALGSIM0(oldn, c, FS_OPT_CONST_PHI); \
return c; \
} \
}
} \
} while(0)
/**
* Do the AddSub optimization, then Transform
......@@ -2333,7 +2339,7 @@ static ir_node *transform_node_Add(ir_node *n)
if (mode_is_reference(mode)) {
ir_mode *lmode = get_irn_mode(a);
if (is_Const(b) && is_Const_null(b) && mode_is_int(lmode)) {
if (is_Const(b) && is_Const_null(b) && mode_is_int(lmode)) {
/* an Add(a, NULL) is a hidden Conv */
dbg_info *dbg = get_irn_dbg_info(n);
return new_rd_Conv(dbg, get_nodes_block(n), a, mode);
......@@ -5363,7 +5369,6 @@ static ir_node *transform_node_shl_shr(ir_node *n)
ir_node *left;
ir_node *right = get_binop_right(n);
ir_node *x;
ir_graph *irg;
ir_node *block;
ir_mode *mode;
dbg_info *dbgi;
......@@ -5428,7 +5433,6 @@ static ir_node *transform_node_shl_shr(ir_node *n)
assert(tv_mask != tarval_bad);
assert(get_tarval_mode(tv_mask) == mode);
irg = get_irn_irg(n);
block = get_nodes_block(n);
dbgi = get_irn_dbg_info(n);
......@@ -6412,7 +6416,8 @@ static ir_op_ops *firm_set_default_node_cmp_attr(ir_opcode code, ir_op_ops *ops)
CASE(Dummy);
/* FIXME CopyB */
default:
/* leave NULL */;
/* leave NULL */
break;
}
return ops;
......
......@@ -46,122 +46,6 @@
#include "iterator.h"
#include "bitset.h"
#include "dbginfo_t.h"
/**
* Init the string.
*/
static void str_init(void *object, size_t n)
{
(void) n;
strcpy(object, "");
}
/**
* append a char to a string buffer.
*/
static void str_append_char(void *object, size_t n, char ch)
{
char buf[2];
buf[0] = ch;
buf[1] = 0;
strncat(object, buf, n);
}
/**
* append a string to a string buffer.
*/
static void str_append_str(void *object, size_t n, const char *str)
{
strncat(object, str, n);
}
/**
* Init the file. i.e. do nothing.
*/
static void file_init(void *object, size_t n)
{
(void) object;
(void) n;
}
/**
* append a char to a file.
*/
static void file_append_char(void *object, size_t n, char ch)
{
(void) n;
fputc(ch, object);
}
/**
* append a string to a file.
*/
static void file_append_str(void *object, size_t n, const char *str)
{
(void) n;
fputs(str, object);
}
/**
* Init the obstack. i.e. do nothing.
*/
static void obst_init(void *object, size_t n)
{
(void) object;
(void) n;
}
/**
* append a char to a obstack.
*/
static void obst_append_char(void *object, size_t n, char ch)
{
struct obstack *obst = object;
(void) n;
obstack_1grow(obst, ch);
}
/**
* append a string to a obstack.
*/
static void obst_append_str(void *object, size_t n, const char *str)
{
struct obstack *obst = object;
(void) n;
obstack_grow(obst, str, strlen(str));
}
/**
* the file appender
*/
static const appender_t file_appender = {
file_init,
file_append_char,
file_append_str
};
/**
* the string buffer appender
*/
static const appender_t str_appender = {
str_init,
str_append_char,
str_append_str
};
/**
* the obstack appender.
*/
static const appender_t obst_appender = {
obst_init,
obst_append_char,
obst_append_str
};
#include "irargs_t.h"
void ir_printf(const char *fmt, ...)
......
......@@ -341,7 +341,6 @@ ir_graph *ir_profile_instrument(const char *filename, unsigned flags)
ir_type *loc_type = NULL;
ir_type *charptr_type;
ir_type *gtp;
ir_node *start_block;
tarval **tarval_array;
tarval **tarval_string;
tarval *tv;
......@@ -460,7 +459,6 @@ ir_graph *ir_profile_instrument(const char *filename, unsigned flags)
wd.symconst = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
irg_block_walk_graph(irg, block_id_walker, NULL, &wd);
start_block = get_irg_start_block(irg);
env.end_block = get_irg_end_block(irg);
irg_block_walk_graph(irg, fix_ssa, NULL, &env);
for (i = get_Block_n_cfgpreds(endbb) - 1; i >= 0; --i) {
......@@ -524,6 +522,7 @@ ir_graph *ir_profile_instrument(const char *filename, unsigned flags)
add_compound_ent_value_w_path(ent_locations, n, path);
}
pmap_destroy(wd.fname_map);
current_ir_graph = rem;
}
return gen_initializer_irg(ent_filename, bblock_id, bblock_counts, n_blocks);
}
......
......@@ -90,7 +90,7 @@ static void prepare_nodes(ir_node *irn, void *env)
firm_alloc_frag_arr(irn, op_Bound, &irn->attr.bound.exc.frag_arr);
break;
default:
;
break;
}
}
......
......@@ -462,18 +462,18 @@ struct ir_graph {
unsigned additional_properties; /**< Additional graph properties. */
/* -- Fields indicating different states of irgraph -- */
unsigned state;
irg_phase_state phase_state; /**< Compiler phase. */
op_pin_state irg_pinned_state; /**< Flag for status of nodes. */
irg_outs_state outs_state; /**< Out edges. */
irg_dom_state dom_state; /**< Dominator state information. */
irg_dom_state pdom_state; /**< Post Dominator state information. */
ir_typeinfo_state typeinfo_state; /**< Validity of type information. */
ir_graph_state_t state;
irg_phase_state phase_state; /**< Compiler phase. */
op_pin_state irg_pinned_state; /**< Flag for status of nodes. */
irg_outs_state outs_state; /**< Out edges. */
irg_dom_state dom_state; /**< Dominator state information. */
irg_dom_state pdom_state; /**< Post Dominator state information. */
ir_typeinfo_state typeinfo_state; /**< Validity of type information. */
irg_callee_info_state callee_info_state; /**< Validity of callee information. */
irg_loopinfo_state loopinfo_state; /**< State of loop information. */
ir_class_cast_state class_cast_state; /**< Kind of cast operations in code. */
irg_loopinfo_state loopinfo_state; /**< State of loop information. */
ir_class_cast_state class_cast_state; /**< Kind of cast operations in code. */
irg_extblk_info_state extblk_state; /**< State of extended basic block info. */
exec_freq_state execfreq_state; /**< Execution frequency state. */
exec_freq_state execfreq_state; /**< Execution frequency state. */
ir_entity_usage_computed_state entity_usage_state;
unsigned mem_disambig_opt; /**< Options for the memory disambiguator. */
unsigned fp_model; /**< floating point model of the graph. */
......
......@@ -240,7 +240,7 @@ static void fix_const_call_lists(ir_graph *irg, env_t *ctx)
break;
}
default:
;
break;
}
}
......@@ -379,7 +379,7 @@ static void fix_nothrow_call_list(ir_graph *irg, ir_node *call_list, ir_node *pr
break;
}
default:
;
break;
}
}
......@@ -403,7 +403,6 @@ static void fix_nothrow_call_list(ir_graph *irg, ir_node *call_list, ir_node *pr
/* forward */
static unsigned check_const_or_pure_function(ir_graph *irg, int top);
static unsigned check_nothrow_or_malloc(ir_graph *irg, int top);
/**
* Calculate the bigger property of two. Handle the temporary flag right.
......
......@@ -459,7 +459,6 @@ static ir_entity *clone_method(quadruple_t *q)
static ir_node *new_cl_Call(ir_node *call, ir_entity *new_entity, int pos)
{
ir_node **in;
ir_type *mtp;
int i, n_params, new_params = 0;
ir_node *callee;
symconst_symbol sym;
......@@ -469,7 +468,6 @@ static ir_node *new_cl_Call(ir_node *call, ir_entity *new_entity, int pos)
sym.entity_p = new_entity;
callee = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent);
mtp = get_entity_type(new_entity);
n_params = get_Call_n_params(call);
NEW_ARR_A(ir_node *, in, n_params - 1);
......
......@@ -252,7 +252,6 @@ static int cancel_out_casts(ir_node *cast)
{
ir_node *orig, *pred = get_Cast_op(cast);
ir_type *tp_cast, *tp_pred, *tp_orig;
int ref_depth = 0;
if (!is_Cast(pred)) return 0;
orig = get_Cast_op(pred);
......@@ -267,7 +266,6 @@ static int cancel_out_casts(ir_node *cast)
tp_cast = get_pointer_points_to_type(tp_cast);
tp_pred = get_pointer_points_to_type(tp_pred);
tp_orig = get_pointer_points_to_type(tp_orig);
ref_depth++;
}
if (!is_Class_type(tp_cast) || !is_Class_type(tp_pred) || !is_Class_type(tp_orig))
......
......@@ -396,8 +396,6 @@ static inline void _set_entity_dbg_info(ir_entity *ent, dbg_info *db)
ent->dbi = db;
}
int is_entity_final(const ir_entity *entity);
#define is_entity(thing) _is_entity(thing)
#define get_entity_name(ent) _get_entity_name(ent)
#define get_entity_ident(ent) _get_entity_ident(ent)
......
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