From a1fc5d2a5ed66510bbb2199ea5ee75416755cf1c Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 21 Oct 2011 12:51:31 +0200 Subject: [PATCH] remove a bunch of comments marking end of blocks They're adding more noise than they provide gain in readability. They also make extra work to keep up to date. --- ir/ana/callgraph.c | 4 +- ir/ana/irconsconfirm.c | 20 ++-- ir/ana/irmemory.c | 50 +++++----- ir/ana/irscc.c | 4 +- ir/be/bestabs.c | 44 ++++----- ir/be/ia32/ia32_x87.c | 102 ++++++++++---------- ir/common/firm_common.c | 2 +- ir/ir/irdump.c | 14 +-- ir/ir/iredges.c | 2 +- ir/ir/irnode.c | 2 +- ir/ir/irnode_t.h | 2 +- ir/ir/irop.c | 28 +++--- ir/ir/iropt.c | 198 +++++++++++++++++++------------------- ir/ir/irpass.c | 22 ++--- ir/tr/type_finalization.c | 2 +- ir/tv/strcalc.c | 2 +- 16 files changed, 251 insertions(+), 247 deletions(-) diff --git a/ir/ana/callgraph.c b/ir/ana/callgraph.c index c5010993b..e5a695656 100644 --- a/ir/ana/callgraph.c +++ b/ir/ana/callgraph.c @@ -794,7 +794,9 @@ static ir_graph *find_tail(const ir_graph *n) found = largest_dfn_pred(m, &res_index); break; } - if (m == n) { break; } /* It's not an unreachable loop, either. */ + /* It's not an unreachable loop, either. */ + if (m == n) + break; } //assert(0 && "no head found on stack"); } diff --git a/ir/ana/irconsconfirm.c b/ir/ana/irconsconfirm.c index 999447200..237b99259 100644 --- a/ir/ana/irconsconfirm.c +++ b/ir/ana/irconsconfirm.c @@ -122,7 +122,7 @@ static void handle_case(ir_node *block, ir_node *irn, long nr, env_t *env) env->num_consts += 1; } } -} /* handle_case */ +} /** * Handle a mode_b input of Cond nodes. @@ -398,7 +398,7 @@ static void handle_if(ir_node *block, ir_node *cmp, ir_relation rel, env_t *env) } } } -} /* handle_if */ +} /** * Pre-block-walker: Called for every block to insert Confirm nodes @@ -454,7 +454,7 @@ static void insert_Confirm_in_block(ir_node *block, void *data) handle_case(block, get_Cond_selector(cond), proj_nr, env); } -} /* insert_Confirm_in_block */ +} /** * Checks if a node is a non-null Confirm. @@ -480,7 +480,7 @@ static int is_non_null_Confirm(const ir_node *ptr) if (is_SymConst_addr_ent(ptr)) return 1; return 0; -} /* is_non_null_Confirm */ +} /** * The given pointer will be dereferenced, add non-null Confirms. @@ -527,7 +527,7 @@ static void insert_non_null(ir_node *ptr, ir_node *block, env_t *env) env->num_confirms += 1; } } -} /* insert_non_null */ +} /** * Pre-walker: Called for every node to insert Confirm nodes @@ -554,7 +554,7 @@ static void insert_Confirm(ir_node *node, void *data) default: break; } -} /* insert_Confirm */ +} /* * Construct Confirm nodes @@ -600,13 +600,13 @@ void construct_confirms(ir_graph *irg) /* deactivate edges if they where off */ if (! edges_active) edges_deactivate(irg); -} /* construct_confirms */ +} /* Construct a pass. */ ir_graph_pass_t *construct_confirms_pass(const char *name) { return def_graph_pass(name ? name : "confirm", construct_confirms); -} /* construct_confirms_pass */ +} static void remove_confirm(ir_node *n, void *env) { @@ -626,10 +626,10 @@ static void remove_confirm(ir_node *n, void *env) void remove_confirms(ir_graph *irg) { irg_walk_graph(irg, NULL, remove_confirm, NULL); -} /* remove_confirms */ +} /* Construct a pass. */ ir_graph_pass_t *remove_confirms_pass(const char *name) { return def_graph_pass(name ? name : "rem_confirm", remove_confirms); -} /* remove_confirms_pass */ +} diff --git a/ir/ana/irmemory.c b/ir/ana/irmemory.c index 20d980492..f1f587016 100644 --- a/ir/ana/irmemory.c +++ b/ir/ana/irmemory.c @@ -77,25 +77,25 @@ unsigned get_irg_memory_disambiguator_options(const ir_graph *irg) if (opt & aa_opt_inherited) return global_mem_disamgig_opt; return opt; -} /* get_irg_memory_disambiguator_options */ +} /* Set the memory disambiguator options for a graph. */ void set_irg_memory_disambiguator_options(ir_graph *irg, unsigned options) { irg->mem_disambig_opt = options & ~aa_opt_inherited; -} /* set_irg_memory_disambiguator_options */ +} /* Set the global disambiguator options for all graphs not having local options. */ void set_irp_memory_disambiguator_options(unsigned options) { global_mem_disamgig_opt = options; -} /* set_irp_memory_disambiguator_options */ +} /* Get the base storage class (ignore modifier) */ ir_storage_class_class_t get_base_sc(ir_storage_class_class_t x) { return x & ~ir_sc_modifiers; -} /* get_base_sc */ +} /** * Find the base address and entity of an Sel node. @@ -115,7 +115,7 @@ static ir_node *find_base_adr(const ir_node *sel, ir_entity **pEnt) } *pEnt = get_Sel_entity(sel); return ptr; -} /* find_base_adr */ +} /** * Check if a given Const node is greater or equal a given size. @@ -134,7 +134,7 @@ static ir_alias_relation check_const(const ir_node *cns, int size) return tarval_is_null(tv) ? ir_may_alias : ir_no_alias; tv_size = new_tarval_from_long(size, get_tarval_mode(tv)); return tarval_cmp(tv_size, tv) & (ir_relation_less_equal) ? ir_no_alias : ir_may_alias; -} /* check_const */ +} /** * Treat idx1 and idx2 as integer indexes and check if they differ always more than size. @@ -298,7 +298,7 @@ static ir_alias_relation different_index(const ir_node *idx1, const ir_node *idx } return ir_may_alias; -} /* different_index */ +} /** * Two Sel addresses have the same base address, check if there offsets are @@ -354,7 +354,7 @@ static ir_alias_relation different_sel_offsets(const ir_node *sel1, const ir_nod (void) different_index; #endif return ir_may_alias; -} /* different_sel_offsets */ +} /** * Determine the alias relation by checking if adr1 and adr2 are pointer @@ -404,7 +404,7 @@ static ir_alias_relation different_types(const ir_node *adr1, const ir_node *adr } } return ir_may_alias; -} /* different_types */ +} /** * Returns non-zero if a node is a result on a malloc-like routine. @@ -428,7 +428,7 @@ static int is_malloc_Result(const ir_node *node) return 0; } return 0; -} /* is_malloc_Result */ +} ir_storage_class_class_t classify_pointer(const ir_node *irn, const ir_entity *ent) @@ -695,7 +695,7 @@ leave_type_based_alias:; /* access points-to information here */ return ir_may_alias; -} /* _get_alias_relation */ +} /* * Determine the alias relation between two addresses. @@ -707,13 +707,13 @@ ir_alias_relation get_alias_relation( ir_alias_relation rel = _get_alias_relation(adr1, mode1, adr2, mode2); DB((dbg, LEVEL_1, "alias(%+F, %+F) = %s\n", adr1, adr2, get_ir_alias_relation_name(rel))); return rel; -} /* get_alias_relation */ +} /* Set a source language specific memory disambiguator function. */ void set_language_memory_disambiguator(DISAMBIGUATOR_FUNC func) { language_disambuigator = func; -} /* set_language_memory_disambiguator */ +} /** The result cache for the memory disambiguator. */ static set *result_cache = NULL; @@ -740,7 +740,7 @@ static int cmp_mem_disambig_entry(const void *elt, const void *key, size_t size) return p1->adr1 == p2->adr1 && p1->adr2 == p2->adr2 && p1->mode1 == p2->mode1 && p1->mode2 == p2->mode2; -} /* cmp_mem_disambig_entry */ +} /** * Initialize the relation cache. @@ -748,7 +748,7 @@ static int cmp_mem_disambig_entry(const void *elt, const void *key, size_t size) void mem_disambig_init(void) { result_cache = new_set(cmp_mem_disambig_entry, 8); -} /* mem_disambig_init */ +} /* * Determine the alias relation between two addresses. @@ -782,7 +782,7 @@ ir_alias_relation get_alias_relation_ex( set_insert(result_cache, &key, sizeof(key), HASH_ENTRY(adr1, adr2)); return key.result; -} /* get_alias_relation_ex */ +} /* Free the relation cache. */ void mem_disambig_term(void) @@ -791,7 +791,7 @@ void mem_disambig_term(void) del_set(result_cache); result_cache = NULL; } -} /* mem_disambig_term */ +} /** * Check the mode of a Load/Store with the mode of the entity @@ -826,7 +826,7 @@ static int is_hidden_cast(const ir_mode *mode, const ir_mode *ent_mode) return true; } return false; -} /* is_hidden_cast */ +} /** * Determine the usage state of a node (or its successor Sels). @@ -1103,7 +1103,7 @@ static void check_initializer_nodes(ir_initializer_t *initializer) return; } panic("invalid initializer found"); -} /* check_initializer_nodes */ +} /** * Mark all entities used in the initializer for the given entity as unknown @@ -1152,7 +1152,7 @@ static void check_initializers(ir_type *tp) check_initializer(ent); } -} /* check_initializers */ +} #ifdef DEBUG_libfirm /** @@ -1201,7 +1201,7 @@ static void check_global_address(ir_node *irn, void *data) flags = get_entity_usage(ent); flags |= determine_entity_usage(irn, ent); set_entity_usage(ent, (ir_entity_usage) flags); -} /* check_global_address */ +} /** * Update the entity usage flags of all global entities. @@ -1288,7 +1288,7 @@ static ir_type *clone_type_and_cache(ir_type *tp) pmap_insert(mtp_map, tp, res); return res; -} /* clone_type_and_cache */ +} /** * Walker: clone all call types of Calls to methods having the @@ -1314,7 +1314,7 @@ static void update_calls_to_private(ir_node *call, void *env) } } } -} /* update_calls_to_private */ +} /* Mark all private methods, i.e. those of which all call sites are known. */ void mark_private_methods(void) @@ -1352,10 +1352,10 @@ void mark_private_methods(void) all_irg_walk(NULL, update_calls_to_private, NULL); pmap_destroy(mtp_map); -} /* mark_private_methods */ +} /* create a pass for mark_private_methods() */ ir_prog_pass_t *mark_private_methods_pass(const char *name) { return def_prog_pass(name ? name : "mark_private_methods", mark_private_methods); -} /* mark_private_methods_pass */ +} diff --git a/ir/ana/irscc.c b/ir/ana/irscc.c index 82cb67e5d..c83fadbb6 100644 --- a/ir/ana/irscc.c +++ b/ir/ana/irscc.c @@ -609,7 +609,9 @@ static ir_node *find_tail(ir_node *n) res_index = largest_dfn_pred (m); break; } - if (m == n) { break; } /* It's not an unreachable loop, either. */ + /* It's not an unreachable loop, either. */ + if (m == n) + break; } //assert(0 && "no head found on stack"); } diff --git a/ir/be/bestabs.c b/ir/be/bestabs.c index 6253a95b0..05e8fd48f 100644 --- a/ir/be/bestabs.c +++ b/ir/be/bestabs.c @@ -146,7 +146,7 @@ static unsigned get_type_number(stabs_handle *h, ir_type *tp) num = (unsigned)PTR_TO_INT(entry->value); } return num; -} /* get_type_number */ +} /** * Map a given Type to void by assigned the type number 0. @@ -164,7 +164,7 @@ static void gen_void_type(stabs_handle *h) (void) h; be_emit_irprintf("\t.stabs\t\"void:t%u=%u\",%d,0,0,0\n", 0, 0, N_LSYM); be_emit_write_line(); -} /* gen_void_type */ +} typedef struct walker_env { stabs_handle *h; @@ -242,13 +242,13 @@ static void gen_primitive_type(stabs_handle *h, ir_type *tp) Ignore it here as it's name is remapped to "void". */ map_to_void(h, tp); return; - } /* if */ + } #if 0 if (get_mode_size_bits(mode) & 7) { /* this is a bitfield type, ignore it */ return; - } /* if */ + } #endif type_num = get_type_number(h, tp); @@ -269,7 +269,7 @@ static void gen_primitive_type(stabs_handle *h, ir_type *tp) be_emit_irprintf(":t%u=r1;%d;0;\",%d,0,0,0\n", type_num, size, N_LSYM); be_emit_write_line(); } -} /* gen_primitive_type */ +} /** * Generates an enum type @@ -295,7 +295,7 @@ static void gen_enum_type(stabs_handle *h, ir_type *tp) } be_emit_irprintf(";\",%d,0,0,0\n", N_LSYM); be_emit_write_line(); -} /* gen_enum_type */ +} /** * print a pointer type @@ -330,7 +330,7 @@ static void gen_pointer_type(wenv_t *env, ir_type *tp) print_pointer_type(h, tp, 0); be_emit_irprintf("\",%d,0,0,0\n", N_LSYM); be_emit_write_line(); -} /* gen_pointer_type */ +} /** * print an array type @@ -387,7 +387,7 @@ static void gen_array_type(wenv_t *env, ir_type *tp) be_emit_irprintf("\",%d,0,0,0\n", N_LSYM); be_emit_write_line(); -} /* gen_array_type */ +} /** * Generates a struct/union type @@ -465,7 +465,7 @@ static void gen_struct_union_type(wenv_t *env, ir_type *tp) } be_emit_irprintf(";\",%d,0,0,0\n", N_LSYM); be_emit_write_line(); -} /* gen_struct_type */ +} /** * Generates a method type @@ -503,7 +503,7 @@ static void gen_method_type(wenv_t *env, ir_type *tp) } be_emit_irprintf("\",%d,0,0,0\n", N_LSYM); be_emit_write_line(); -} /* gen_method_type */ +} /** * type-walker: generate declaration for simple types, @@ -522,7 +522,7 @@ static void walk_type(type_or_ent tore, void *ctx) return; } else { return; - } /* if */ + } switch (get_type_tpop_code(tp)) { case tpo_class: @@ -562,8 +562,8 @@ static void walk_type(type_or_ent tore, void *ctx) break; default: assert(! "Unknown tpop code"); - } /* switch */ -} /* walk_type */ + } +} /** * generate declaration for all types @@ -604,9 +604,9 @@ static void finish_types(wenv_t *env) break; default: assert(! "Unknown tpop code"); - } /* switch */ - } /* while */ -} /* finish_types */ + } + } +} /** * generate all types. @@ -625,7 +625,7 @@ static void gen_types(stabs_handle *h) finish_types(&env); del_waitq(env.wq); -} /* gen_types */ +} /* -------------------------- I/F ----------------------------- */ @@ -758,7 +758,7 @@ static void stabs_method_begin(dbg_handle *handle, const ir_entity *ent) be_emit_irprintf("\",%d,0,0,%d\n", N_PSYM, ofs); be_emit_write_line(); } -} /* stabs_method_begin */ +} /** * dump the stabs for a method end @@ -806,7 +806,7 @@ static void stabs_method_end(dbg_handle *handle) h->cur_ent = NULL; h->layout = NULL; -} /* stabs_method_end */ +} /** * dump types @@ -819,7 +819,7 @@ static void stabs_types(dbg_handle *handle) h->next_type_nr++; gen_void_type(h); gen_types(h); -} /* stabs_types */ +} /** * dump a variable in the global type @@ -847,7 +847,7 @@ static void stabs_variable(dbg_handle *handle, const ir_entity *ent) buf[sizeof(buf) - 1] = '\0'; be_emit_string(buf); -} /* stabs_variable */ +} /** * Close the stabs handler. @@ -857,7 +857,7 @@ static void stabs_close(dbg_handle *handle) stabs_handle *h = (stabs_handle *)handle; pmap_destroy(h->type_map); free(h); -} /* stabs_close */ +} /** The stabs operations. */ static const debug_ops stabs_ops = { diff --git a/ir/be/ia32/ia32_x87.c b/ir/be/ia32/ia32_x87.c index 7c184b959..9876571ea 100644 --- a/ir/be/ia32/ia32_x87.c +++ b/ir/be/ia32/ia32_x87.c @@ -154,7 +154,7 @@ struct x87_simulator { static int x87_get_depth(const x87_state *state) { return state->depth; -} /* x87_get_depth */ +} /** * Return the virtual register index at st(pos). @@ -168,7 +168,7 @@ static int x87_get_st_reg(const x87_state *state, int pos) { assert(pos < state->depth); return state->st[MASK_TOS(state->tos + pos)].reg_idx; -} /* x87_get_st_reg */ +} #ifdef DEBUG_libfirm /** @@ -183,7 +183,7 @@ static ir_node *x87_get_st_node(const x87_state *state, int pos) { assert(pos < state->depth); return state->st[MASK_TOS(state->tos + pos)].node; -} /* x87_get_st_node */ +} /** * Dump the stack for debugging. @@ -199,7 +199,7 @@ static void x87_dump_stack(const x87_state *state) x87_get_st_node(state, i))); } DB((dbg, LEVEL_2, "<-- TOS\n")); -} /* x87_dump_stack */ +} #endif /* DEBUG_libfirm */ /** @@ -218,7 +218,7 @@ static void x87_set_st(x87_state *state, int reg_idx, ir_node *node, int pos) DB((dbg, LEVEL_2, "After SET_REG: ")); DEBUG_ONLY(x87_dump_stack(state);) -} /* x87_set_st */ +} /** * Set the tos virtual register. @@ -230,7 +230,7 @@ static void x87_set_st(x87_state *state, int reg_idx, ir_node *node, int pos) static void x87_set_tos(x87_state *state, int reg_idx, ir_node *node) { x87_set_st(state, reg_idx, node, 0); -} /* x87_set_tos */ +} /** * Swap st(0) with st(pos). @@ -249,7 +249,7 @@ static void x87_fxch(x87_state *state, int pos) DB((dbg, LEVEL_2, "After FXCH: ")); DEBUG_ONLY(x87_dump_stack(state);) -} /* x87_fxch */ +} /** * Convert a virtual register to the stack index. @@ -268,7 +268,7 @@ static int x87_on_stack(const x87_state *state, int reg_idx) if (state->st[MASK_TOS(tos + i)].reg_idx == reg_idx) return i; return -1; -} /* x87_on_stack */ +} /** * Push a virtual Register onto the stack, double pushed allowed. @@ -287,7 +287,7 @@ static void x87_push_dbl(x87_state *state, int reg_idx, ir_node *node) state->st[state->tos].node = node; DB((dbg, LEVEL_2, "After PUSH: ")); DEBUG_ONLY(x87_dump_stack(state);) -} /* x87_push_dbl */ +} /** * Push a virtual Register onto the stack, double pushes are NOT allowed. @@ -302,7 +302,7 @@ static void x87_push(x87_state *state, int reg_idx, ir_node *node) assert(x87_on_stack(state, reg_idx) == -1 && "double push"); x87_push_dbl(state, reg_idx, node); -} /* x87_push */ +} /** * Pop a virtual Register from the stack. @@ -317,7 +317,7 @@ static void x87_pop(x87_state *state) state->tos = MASK_TOS(state->tos + 1); DB((dbg, LEVEL_2, "After POP: ")); DEBUG_ONLY(x87_dump_stack(state);) -} /* x87_pop */ +} /** * Empty the fpu stack @@ -352,7 +352,7 @@ static blk_state *x87_get_bl_state(x87_simulator *sim, ir_node *block) } return PTR_TO_BLKSTATE(entry->value); -} /* x87_get_bl_state */ +} /** * Creates a new x87 state. @@ -367,7 +367,7 @@ static x87_state *x87_alloc_state(x87_simulator *sim) res->sim = sim; return res; -} /* x87_alloc_state */ +} /** * Clone a x87 state. @@ -383,7 +383,7 @@ static x87_state *x87_clone_state(x87_simulator *sim, const x87_state *src) *res = *src; return res; -} /* x87_clone_state */ +} /** * Patch a virtual instruction into a x87 one and return @@ -416,7 +416,7 @@ static ir_node *x87_patch_insn(ir_node *n, ir_op *op) } else if (mode_is_float(mode)) set_irn_mode(n, ia32_reg_classes[CLASS_ia32_st].mode); return res; -} /* x87_patch_insn */ +} /** * Returns the first Proj of a mode_T node having a given mode. @@ -438,7 +438,7 @@ static ir_node *get_irn_Proj_for_mode(ir_node *n, ir_mode *m) } return NULL; -} /* get_irn_Proj_for_mode */ +} /** * Wrap the arch_* function here so we can check for errors. @@ -449,7 +449,7 @@ static inline const arch_register_t *x87_get_irn_register(const ir_node *irn) assert(res->reg_class == &ia32_reg_classes[CLASS_ia32_vfp]); return res; -} /* x87_get_irn_register */ +} static inline const arch_register_t *x87_irn_get_register(const ir_node *irn, int pos) @@ -458,7 +458,7 @@ static inline const arch_register_t *x87_irn_get_register(const ir_node *irn, assert(res->reg_class == &ia32_reg_classes[CLASS_ia32_vfp]); return res; -} /* x87_irn_get_register */ +} static inline const arch_register_t *get_st_reg(int index) { @@ -493,7 +493,7 @@ static ir_node *x87_fxch_shuffle(x87_state *state, int pos, ir_node *block) x87_fxch(state, pos); return fxch; -} /* x87_fxch_shuffle */ +} /** * Calculate the necessary permutations to reach dst_state. @@ -634,7 +634,7 @@ static x87_state *x87_shuffle(x87_simulator *sim, ir_node *block, } } return state; -} /* x87_shuffle */ +} /** * Create a fxch node before another node. @@ -663,7 +663,7 @@ static ir_node *x87_create_fxch(x87_state *state, ir_node *n, int pos) sched_add_before(n, fxch); DB((dbg, LEVEL_1, "<<< %s %s, %s\n", get_irn_opname(fxch), attr->x87[0]->name, attr->x87[2]->name)); return fxch; -} /* x87_create_fxch */ +} /** * Create a fpush before node n. @@ -690,7 +690,7 @@ static void x87_create_fpush(x87_state *state, ir_node *n, int pos, int op_idx) sched_add_before(n, fpush); DB((dbg, LEVEL_1, "<<< %s %s, %s\n", get_irn_opname(fpush), attr->x87[0]->name, attr->x87[2]->name)); -} /* x87_create_fpush */ +} /** * Create a fpop before node n. @@ -723,7 +723,7 @@ static ir_node *x87_create_fpop(x87_state *state, ir_node *n, int num) DB((dbg, LEVEL_1, "<<< %s %s\n", get_irn_opname(fpop), attr->x87[0]->name)); } while (--num > 0); return fpop; -} /* x87_create_fpop */ +} /* --------------------------------- liveness ------------------------------------------ */ @@ -769,7 +769,7 @@ static vfp_liveness vfp_liveness_transfer(ir_node *irn, vfp_liveness live) } } return live; -} /* vfp_liveness_transfer */ +} /** * Put all live virtual registers at the end of a block into a bitset. @@ -798,7 +798,7 @@ static vfp_liveness vfp_liveness_end_of_block(x87_simulator *sim, const ir_node } return live; -} /* vfp_liveness_end_of_block */ +} /** get the register mask from an arch_register */ #define REGMASK(reg) (1 << (arch_register_get_index(reg))) @@ -818,7 +818,7 @@ static unsigned vfp_live_args_after(x87_simulator *sim, const ir_node *pos, unsi assert(idx < sim->n_idx); return sim->live[idx] & ~kill; -} /* vfp_live_args_after */ +} /** * Calculate the liveness for a whole block and cache it. @@ -846,7 +846,7 @@ static void update_liveness(x87_simulator *sim, ir_node *block) } idx = get_irn_idx(block); sim->live[idx] = live; -} /* update_liveness */ +} /** * Returns true if a register is live in a set. @@ -873,7 +873,7 @@ static void vfp_dump_live(vfp_liveness live) } } DB((dbg, LEVEL_2, "\n")); -} /* vfp_dump_live */ +} #endif /* DEBUG_libfirm */ /* --------------------------------- simulators ---------------------------------------- */ @@ -1050,7 +1050,7 @@ static int sim_binop(x87_state *state, ir_node *n, const exchange_tmpl *tmpl) } return NO_NODE_ADDED; -} /* sim_binop */ +} /** * Simulate a virtual Unop. @@ -1095,7 +1095,7 @@ static int sim_unop(x87_state *state, ir_node *n, ir_op *op) DB((dbg, LEVEL_1, "<<< %s -> %s\n", get_irn_opname(n), out->name)); return NO_NODE_ADDED; -} /* sim_unop */ +} /** * Simulate a virtual Load instruction. @@ -1119,7 +1119,7 @@ static int sim_load(x87_state *state, ir_node *n, ir_op *op, int res_pos) DB((dbg, LEVEL_1, "<<< %s -> %s\n", get_irn_opname(n), arch_register_get_name(out))); return NO_NODE_ADDED; -} /* sim_load */ +} /** * Rewire all users of @p old_val to @new_val iff they are scheduled after @p store. @@ -1148,7 +1148,7 @@ static void collect_and_rewire_users(ir_node *store, ir_node *old_val, ir_node * } } } -} /* collect_and_rewire_users */ +} /** * Simulate a virtual Store. @@ -1257,7 +1257,7 @@ static int sim_store(x87_state *state, ir_node *n, ir_op *op, ir_op *op_p) DB((dbg, LEVEL_1, "<<< %s %s ->\n", get_irn_opname(n), arch_register_get_name(op2))); return insn; -} /* sim_store */ +} #define _GEN_BINOP(op, rev) \ static int sim_##op(x87_state *state, ir_node *n) { \ @@ -1337,7 +1337,7 @@ static int sim_fisttp(x87_state *state, ir_node *n) DB((dbg, LEVEL_1, "<<< %s %s ->\n", get_irn_opname(n), arch_register_get_name(op2))); return NO_NODE_ADDED; -} /* sim_fisttp */ +} /** * Simulate a virtual FtstFnstsw. @@ -1380,7 +1380,7 @@ static int sim_FtstFnstsw(x87_state *state, ir_node *n) x87_create_fpop(state, sched_next(n), 1); return NO_NODE_ADDED; -} /* sim_FtstFnstsw */ +} /** * Simulate a Fucom @@ -1619,7 +1619,7 @@ static int sim_Fucom(x87_state *state, ir_node *n) } return NO_NODE_ADDED; -} /* sim_Fucom */ +} /** * Simulate a Keep. @@ -1659,7 +1659,7 @@ static int sim_Keep(x87_state *state, ir_node *node) DEBUG_ONLY(x87_dump_stack(state);) return NO_NODE_ADDED; -} /* sim_Keep */ +} /** * Keep the given node alive by adding a be_Keep. @@ -1747,7 +1747,7 @@ static ir_node *create_Copy(x87_state *state, ir_node *n) arch_set_irn_register(res, out); return res; -} /* create_Copy */ +} /** * Simulate a be_Copy. @@ -1850,7 +1850,7 @@ static int sim_Copy(x87_state *state, ir_node *n) } } return NO_NODE_ADDED; -} /* sim_Copy */ +} /** * Returns the vf0 result Proj of a Call. @@ -1871,7 +1871,7 @@ static ir_node *get_call_result_proj(ir_node *call) } return NULL; -} /* get_call_result_proj */ +} /** * Simulate a ia32_Call. @@ -1919,7 +1919,7 @@ end_call: DEBUG_ONLY(x87_dump_stack(state);) return NO_NODE_ADDED; -} /* sim_Call */ +} /** * Simulate a be_Return. @@ -1948,7 +1948,7 @@ static int sim_Return(x87_state *state, ir_node *n) x87_pop(state); return NO_NODE_ADDED; -} /* sim_Return */ +} typedef struct perm_data_t { const arch_register_t *in; @@ -2004,7 +2004,7 @@ static int sim_Perm(x87_state *state, ir_node *irn) DB((dbg, LEVEL_1, "<<< %+F\n", irn)); return NO_NODE_ADDED; -} /* sim_Perm */ +} /** * Kill any dead registers at block start by popping them from the stack. @@ -2091,7 +2091,7 @@ static x87_state *x87_kill_deads(x87_simulator *sim, ir_node *block, x87_state * keep_alive(keep); } return state; -} /* x87_kill_deads */ +} /** * Run a simulation and fix all virtual instructions for a block. @@ -2181,7 +2181,7 @@ static void x87_simulate_block(x87_simulator *sim, ir_node *block) } } bl_state->end = state; -} /* x87_simulate_block */ +} /** * Register a simulator function. @@ -2193,7 +2193,7 @@ static void register_sim(ir_op *op, sim_func func) { assert(op->ops.generic == NULL); op->ops.generic = (op_func) func; -} /* register_sim */ +} /** * Create a new x87 simulator. @@ -2236,7 +2236,7 @@ static void x87_init_simulator(x87_simulator *sim, ir_graph *irg) register_sim(op_be_Return, sim_Return); register_sim(op_be_Perm, sim_Perm); register_sim(op_be_Keep, sim_Keep); -} /* x87_init_simulator */ +} /** * Destroy a x87 simulator. @@ -2248,7 +2248,7 @@ static void x87_destroy_simulator(x87_simulator *sim) pmap_destroy(sim->blk_states); obstack_free(&sim->obst, NULL); DB((dbg, LEVEL_1, "x87 Simulator stopped\n\n")); -} /* x87_destroy_simulator */ +} /** * Pre-block walker: calculate the liveness information for the block @@ -2258,7 +2258,7 @@ static void update_liveness_walker(ir_node *block, void *data) { x87_simulator *sim = (x87_simulator*)data; update_liveness(sim, block); -} /* update_liveness_walker */ +} /* * Run a simulation and fix all virtual instructions for a graph. @@ -2307,10 +2307,10 @@ void ia32_x87_simulate_graph(ir_graph *irg) /* kill it */ del_waitq(sim.worklist); x87_destroy_simulator(&sim); -} /* ia32_x87_simulate_graph */ +} /* Initializes the x87 simulator. */ void ia32_init_x87(void) { FIRM_DBG_REGISTER(dbg, "firm.be.ia32.x87"); -} /* ia32_init_x87 */ +} diff --git a/ir/common/firm_common.c b/ir/common/firm_common.c index 2196b9c73..fc244fe52 100644 --- a/ir/common/firm_common.c +++ b/ir/common/firm_common.c @@ -38,4 +38,4 @@ firm_kind get_kind(const void *firm_thing) { return POINTER_READ(firm_thing, sizeof(firm_kind)) ? *(firm_kind *)firm_thing : k_BAD; -} /* get_kind */ +} diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 699330b2f..7d1caaf7c 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -1005,7 +1005,7 @@ static void dump_node_nodeattr(FILE *F, ir_node *n) default: break; - } /* end switch */ + } } static void dump_node_ana_vals(FILE *F, ir_node *n) @@ -1743,7 +1743,7 @@ static void print_typespecific_info(FILE *F, ir_type *tp) break; default: break; - } /* switch type */ + } } #endif @@ -1770,7 +1770,7 @@ static void print_typespecific_vcgattr(FILE *F, ir_type *tp) break; default: break; - } /* switch type */ + } } void dump_type_node(FILE *F, ir_type *tp) @@ -1953,12 +1953,12 @@ static void dump_type_info(type_or_ent tore, void *env) break; default: break; - } /* switch type */ + } break; /* case k_type */ } default: printf(" *** irdump, dump_type_info(l.%i), faulty type.\n", __LINE__); - } /* switch kind_or_entity */ + } } /** For dumping class hierarchies. @@ -2003,12 +2003,12 @@ static void dump_class_hierarchy_node(type_or_ent tore, void *ctx) } break; default: break; - } /* switch type */ + } break; /* case k_type */ } default: printf(" *** irdump, dump_class_hierarchy_node(l.%i), faulty type.\n", __LINE__); - } /* switch kind_or_entity */ + } } /*******************************************************************/ diff --git a/ir/ir/iredges.c b/ir/ir/iredges.c index 799dadaf1..54521aa18 100644 --- a/ir/ir/iredges.c +++ b/ir/ir/iredges.c @@ -403,7 +403,7 @@ void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt, } edge_change_cnt(tgt, kind, +1); - } /* else */ + } #ifndef DEBUG_libfirm /* verify list heads */ diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 99a7b2e95..5b71b6386 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -1735,7 +1735,7 @@ unsigned firm_default_hash(const ir_node *node) h = 9*h + HASH_PTR(get_irn_op(node)); return h; -} /* firm_default_hash */ +} /* include generated code */ #include "gen_irnode.c.inl" diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 376a68e48..27faec2d6 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -515,7 +515,7 @@ static inline unsigned _get_irn_idx(const ir_node *node) { static inline dbg_info *_get_irn_dbg_info(const ir_node *n) { return n->dbi; -} /* get_irn_dbg_info */ +} static inline void _set_irn_dbg_info(ir_node *n, dbg_info *db) { n->dbi = db; diff --git a/ir/ir/irop.c b/ir/ir/irop.c index 31adf0cd5..a0e502b3f 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -147,7 +147,7 @@ static ir_op_ops *firm_set_default_copy_attr(unsigned code, ir_op_ops *ops) ops->copy_attr = default_copy_attr; } return ops; -} /* firm_set_default_copy_attr */ +} /* Creates a new ir operation. */ ir_op *new_ir_op(unsigned code, const char *name, op_pin_state p, @@ -179,7 +179,7 @@ ir_op *new_ir_op(unsigned code, const char *name, op_pin_state p, hook_new_ir_op(res); return res; -} /* new_ir_op */ +} void free_ir_op(ir_op *code) { @@ -187,7 +187,7 @@ void free_ir_op(ir_op *code) remove_irp_opcode(code); free(code); -} /* free_ir_op */ +} void ir_op_set_fragile_indices(ir_op *op, int fragile_mem_index, int pn_x_regular, int pn_x_except) @@ -201,17 +201,17 @@ void ir_op_set_fragile_indices(ir_op *op, int fragile_mem_index, const char *get_op_name (const ir_op *op) { return get_id_str(op->name); -} /* get_op_name */ +} unsigned (get_op_code)(const ir_op *op) { return _get_op_code(op); -} /* get_op_code */ +} ident *(get_op_ident)(const ir_op *op) { return _get_op_ident(op); -} /* get_op_ident */ +} const char *get_op_pin_state_name(op_pin_state s) { @@ -224,12 +224,12 @@ const char *get_op_pin_state_name(op_pin_state s) #undef XXX } return ""; -} /* get_op_pin_state_name */ +} op_pin_state (get_op_pinned)(const ir_op *op) { return _get_op_pinned(op); -} /* get_op_pinned */ +} /* Sets op_pin_state_pinned in the opcode. Setting it to floating has no effect for Phi, Block and control flow nodes. */ @@ -237,13 +237,13 @@ void set_op_pinned(ir_op *op, op_pin_state pinned) { if (op == op_Block || op == op_Phi || is_op_cfopcode(op)) return; op->pin_state = pinned; -} /* set_op_pinned */ +} /* retrieve the next free opcode */ unsigned get_next_ir_opcode(void) { return next_iro++; -} /* get_next_ir_opcode */ +} /* Returns the next free n IR opcode number, allows to register a bunch of user ops */ unsigned get_next_ir_opcodes(unsigned num) @@ -251,25 +251,25 @@ unsigned get_next_ir_opcodes(unsigned num) unsigned base = next_iro; next_iro += num; return base; -} /* get_next_ir_opcodes */ +} /* Returns the generic function pointer from an ir operation. */ op_func (get_generic_function_ptr)(const ir_op *op) { return _get_generic_function_ptr(op); -} /* get_generic_function_ptr */ +} /* Store a generic function pointer into an ir operation. */ void (set_generic_function_ptr)(ir_op *op, op_func func) { _set_generic_function_ptr(op, func); -} /* set_generic_function_ptr */ +} /* Returns the ir_op_ops of an ir_op. */ const ir_op_ops *(get_op_ops)(const ir_op *op) { return _get_op_ops(op); -} /* get_op_ops */ +} irop_flags get_op_flags(const ir_op *op) { diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 689430c14..d80444a9d 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -84,7 +84,7 @@ void set_value_of_func(value_of_func func) static ir_tarval *computed_value_Const(const ir_node *n) { return get_Const_tarval(n); -} /* computed_value_Const */ +} /** * Return the value of a 'sizeof', 'alignof' or 'offsetof' SymConst. @@ -115,7 +115,7 @@ static ir_tarval *computed_value_SymConst(const ir_node *n) break; } return tarval_bad; -} /* computed_value_SymConst */ +} /** * Return the value of an Add. @@ -138,7 +138,7 @@ static ir_tarval *computed_value_Add(const ir_node *n) } return tarval_bad; -} /* computed_value_Add */ +} /** * Return the value of a Sub. @@ -166,7 +166,7 @@ static ir_tarval *computed_value_Sub(const ir_node *n) return tarval_sub(ta, tb, mode); return tarval_bad; -} /* computed_value_Sub */ +} /** * Return the value of a Carry. @@ -188,7 +188,7 @@ static ir_tarval *computed_value_Carry(const ir_node *n) return get_mode_null(m); } return tarval_bad; -} /* computed_value_Carry */ +} /** * Return the value of a Borrow. @@ -208,7 +208,7 @@ static ir_tarval *computed_value_Borrow(const ir_node *n) return get_mode_null(m); } return tarval_bad; -} /* computed_value_Borrow */ +} /** * Return the value of an unary Minus. @@ -222,7 +222,7 @@ static ir_tarval *computed_value_Minus(const ir_node *n) return tarval_neg(ta); return tarval_bad; -} /* computed_value_Minus */ +} /** * Return the value of a Mul. @@ -255,7 +255,7 @@ static ir_tarval *computed_value_Mul(const ir_node *n) } } return tarval_bad; -} /* computed_value_Mul */ +} /** * Return the value of an And. @@ -282,7 +282,7 @@ static ir_tarval *computed_value_And(const ir_node *n) } return tarval_bad; -} /* computed_value_And */ +} /** * Return the value of an Or. @@ -308,7 +308,7 @@ static ir_tarval *computed_value_Or(const ir_node *n) return get_mode_all_one(get_irn_mode(n)); } return tarval_bad; -} /* computed_value_Or */ +} /** * Return the value of an Eor. @@ -335,7 +335,7 @@ static ir_tarval *computed_value_Eor(const ir_node *n) return tarval_eor(ta, tb); } return tarval_bad; -} /* computed_value_Eor */ +} /** * Return the value of a Not. @@ -349,7 +349,7 @@ static ir_tarval *computed_value_Not(const ir_node *n) return tarval_not(ta); return tarval_bad; -} /* computed_value_Not */ +} /** * Tests whether a shift shifts more bits than available in the mode @@ -392,7 +392,7 @@ static ir_tarval *computed_value_Shl(const ir_node *n) return get_mode_null(get_irn_mode(n)); return tarval_bad; -} /* computed_value_Shl */ +} /** * Return the value of a Shr. @@ -412,7 +412,7 @@ static ir_tarval *computed_value_Shr(const ir_node *n) return get_mode_null(get_irn_mode(n)); return tarval_bad; -} /* computed_value_Shr */ +} /** * Return the value of a Shrs. @@ -429,7 +429,7 @@ static ir_tarval *computed_value_Shrs(const ir_node *n) return tarval_shrs(ta, tb); } return tarval_bad; -} /* computed_value_Shrs */ +} /** * Return the value of a Rotl. @@ -446,7 +446,7 @@ static ir_tarval *computed_value_Rotl(const ir_node *n) return tarval_rotl(ta, tb); } return tarval_bad; -} /* computed_value_Rotl */ +} bool ir_zero_when_converted(const ir_node *node, ir_mode *dest_mode) { @@ -495,7 +495,7 @@ static ir_tarval *computed_value_Conv(const ir_node *n) return get_mode_null(mode); return tarval_bad; -} /* computed_value_Conv */ +} /** * Calculate the value of a Mux: can be evaluated, if the @@ -515,7 +515,7 @@ static ir_tarval *computed_value_Mux(const ir_node *n) return value_of(v); } return tarval_bad; -} /* computed_value_Mux */ +} /** * Calculate the value of a Confirm: can be evaluated, @@ -529,7 +529,7 @@ static ir_tarval *computed_value_Confirm(const ir_node *n) return tv; } return value_of(get_Confirm_value(n)); -} /* computed_value_Confirm */ +} /** * gives a (conservative) estimation of possible relation when comparing @@ -630,7 +630,7 @@ static ir_tarval *do_computed_value_Div(const ir_node *div) if (ta != tarval_bad && tb != tarval_bad) return tarval_div(ta, tb); return tarval_bad; -} /* do_computed_value_Div */ +} /** * Calculate the value of an integer Mod of two nodes. @@ -647,7 +647,7 @@ static ir_tarval *do_computed_value_Mod(const ir_node *a, const ir_node *b) if (ta != tarval_bad && tb != tarval_bad) return tarval_mod(ta, tb); return tarval_bad; -} /* do_computed_value_Mod */ +} /** * Return the value of a Proj(Div). @@ -659,7 +659,7 @@ static ir_tarval *computed_value_Proj_Div(const ir_node *n) return tarval_bad; return do_computed_value_Div(get_Proj_pred(n)); -} /* computed_value_Proj_Div */ +} /** * Return the value of a Proj(Mod). @@ -673,7 +673,7 @@ static ir_tarval *computed_value_Proj_Mod(const ir_node *n) return do_computed_value_Mod(get_Mod_left(mod), get_Mod_right(mod)); } return tarval_bad; -} /* computed_value_Proj_Mod */ +} /** * Return the value of a Proj. @@ -685,7 +685,7 @@ static ir_tarval *computed_value_Proj(const ir_node *proj) if (n->op->ops.computed_value_Proj != NULL) return n->op->ops.computed_value_Proj(proj); return tarval_bad; -} /* computed_value_Proj */ +} /** * If the parameter n can be computed, return its value, else tarval_bad. @@ -702,7 +702,7 @@ ir_tarval *computed_value(const ir_node *n) if (n->op->ops.computed_value) return n->op->ops.computed_value(n); return tarval_bad; -} /* computed_value */ +} /** * Set the default computed_value evaluator in an ir_op_ops. @@ -756,7 +756,7 @@ static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops return ops; #undef CASE_PROJ #undef CASE -} /* firm_set_default_computed_value */ +} /** * Optimize operations that are commutative and have neutral 0, @@ -795,7 +795,7 @@ static ir_node *equivalent_node_neutral_zero(ir_node *n) } return n; -} /* equivalent_node_neutral_zero */ +} /** * Eor is commutative and has neutral 0. @@ -899,7 +899,7 @@ static ir_node *equivalent_node_Add(ir_node *n) } } return n; -} /* equivalent_node_Add */ +} /** * optimize operations that are not commutative but have neutral 0 on left, @@ -919,7 +919,7 @@ static ir_node *equivalent_node_left_zero(ir_node *n) DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_0); } return n; -} /* equivalent_node_left_zero */ +} #define equivalent_node_Shl equivalent_node_left_zero #define equivalent_node_Shr equivalent_node_left_zero @@ -962,7 +962,7 @@ static ir_node *equivalent_node_Sub(ir_node *n) } } return n; -} /* equivalent_node_Sub */ +} /** @@ -984,7 +984,7 @@ static ir_node *equivalent_node_idempotent_unop(ir_node *n) DBG_OPT_ALGSIM2(oldn, pred, n, FS_OPT_IDEM_UNARY); } return n; -} /* equivalent_node_idempotent_unop */ +} /** Optimize Not(Not(x)) == x. */ #define equivalent_node_Not equivalent_node_idempotent_unop @@ -1023,7 +1023,7 @@ static ir_node *equivalent_node_Mul(ir_node *n) } } return n; -} /* equivalent_node_Mul */ +} /** * Use algebraic simplification a | a = a | 0 = 0 | a = a. @@ -1056,7 +1056,7 @@ static ir_node *equivalent_node_Or(ir_node *n) } return n; -} /* equivalent_node_Or */ +} /** * Optimize a & 0b1...1 = 0b1...1 & a = a & a = (a|X) & a = a. @@ -1124,7 +1124,7 @@ static ir_node *equivalent_node_And(ir_node *n) } } return n; -} /* equivalent_node_And */ +} /** * Try to remove useless Conv's: @@ -1255,7 +1255,7 @@ restart: } } return n; -} /* equivalent_node_Conv */ +} /** * - fold Phi-nodes, iff they have only one predecessor except @@ -1303,7 +1303,7 @@ static ir_node *equivalent_node_Phi(ir_node *n) DBG_OPT_PHI(oldn, n); } return n; -} /* equivalent_node_Phi */ +} /** * Optimize Proj(Tuple). @@ -1318,7 +1318,7 @@ static ir_node *equivalent_node_Proj_Tuple(ir_node *proj) DBG_OPT_TUPLE(oldn, tuple, proj); return proj; -} /* equivalent_node_Proj_Tuple */ +} /** * Optimize a / 1 = a. @@ -1350,7 +1350,7 @@ static ir_node *equivalent_node_Proj_Div(ir_node *proj) } } return proj; -} /* equivalent_node_Proj_Div */ +} /** * Optimize CopyB(mem, x, x) into a Nop. @@ -1372,7 +1372,7 @@ static ir_node *equivalent_node_Proj_CopyB(ir_node *proj) } } return proj; -} /* equivalent_node_Proj_CopyB */ +} /** * Optimize Bounds(idx, idx, upper) into idx. @@ -1422,7 +1422,7 @@ static ir_node *equivalent_node_Proj_Bound(ir_node *proj) } } return proj; -} /* equivalent_node_Proj_Bound */ +} /** * Does all optimizations on nodes that must be done on its Projs @@ -1434,7 +1434,7 @@ static ir_node *equivalent_node_Proj(ir_node *proj) if (n->op->ops.equivalent_node_Proj) return n->op->ops.equivalent_node_Proj(proj); return proj; -} /* equivalent_node_Proj */ +} /** * Remove Id's. @@ -1449,7 +1449,7 @@ static ir_node *equivalent_node_Id(ir_node *n) DBG_OPT_ID(oldn, n); return n; -} /* equivalent_node_Id */ +} /** * Optimize a Mux. @@ -1592,7 +1592,7 @@ ir_node *equivalent_node(ir_node *n) if (n->op->ops.equivalent_node) return n->op->ops.equivalent_node(n); return n; -} /* equivalent_node */ +} /** * Sets the default equivalent node operation for an ir_op_ops. @@ -1645,7 +1645,7 @@ static ir_op_ops *firm_set_default_equivalent_node(ir_opcode code, ir_op_ops *op return ops; #undef CASE #undef CASE_PROJ -} /* firm_set_default_equivalent_node */ +} /** * Returns non-zero if a node is a Phi node @@ -1662,7 +1662,7 @@ static int is_const_Phi(ir_node *n) return 0; } return 1; -} /* is_const_Phi */ +} typedef ir_tarval *(*tarval_sub_type)(ir_tarval *a, ir_tarval *b, ir_mode *mode); typedef ir_tarval *(*tarval_binop_type)(ir_tarval *a, ir_tarval *b); @@ -1740,7 +1740,7 @@ static ir_node *apply_binop_on_phi(ir_node *phi, ir_tarval *other, eval_func eva res[i] = new_r_Const(irg, (ir_tarval*)res[i]); } return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode); -} /* apply_binop_on_phi */ +} /** * Apply an evaluator on a binop with two constant Phi. @@ -1785,7 +1785,7 @@ static ir_node *apply_binop_on_2_phis(ir_node *a, ir_node *b, eval_func eval, ir res[i] = new_r_Const(irg, (ir_tarval*)res[i]); } return new_r_Phi(get_nodes_block(a), n, (ir_node **)res, mode); -} /* apply_binop_on_2_phis */ +} /** * Apply an evaluator on a unop with a constant operator (a Phi). @@ -1823,7 +1823,7 @@ static ir_node *apply_unop_on_phi(ir_node *phi, ir_tarval *(*eval)(ir_tarval *)) res[i] = new_r_Const(irg, (ir_tarval*)res[i]); } return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode); -} /* apply_unop_on_phi */ +} /** * Apply a conversion on a constant operator (a Phi). @@ -1858,7 +1858,7 @@ static ir_node *apply_conv_on_phi(ir_node *phi, ir_mode *mode) res[i] = new_r_Const(irg, (ir_tarval*)res[i]); } return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode); -} /* apply_conv_on_phi */ +} /** * Transform AddP(P, ConvIs(Iu)), AddP(P, ConvIu(Is)) and @@ -1935,7 +1935,7 @@ static ir_node *transform_node_AddSub(ir_node *n) } return n; -} /* transform_node_AddSub */ +} #define HANDLE_BINOP_PHI(eval, a, b, c, mode) \ do { \ @@ -2064,7 +2064,7 @@ static ir_node *transform_node_Add(ir_node *n) } return n; -} /* transform_node_Add */ +} /** * returns -cnst or NULL if impossible @@ -2404,7 +2404,7 @@ restart: } } return n; -} /* transform_node_Sub */ +} /** * Several transformation done on n*n=2n bits mul. @@ -2568,7 +2568,7 @@ static ir_node *transform_node_Mul(ir_node *n) } } return arch_dep_replace_mul_with_shifts(n); -} /* transform_node_Mul */ +} /** * Transform a Div Node. @@ -2680,7 +2680,7 @@ make_tuple: set_Tuple_pred(n, pn_Div_res, value); } return n; -} /* transform_node_Div */ +} /** * Transform a Mod node. @@ -2772,7 +2772,7 @@ make_tuple: set_Tuple_pred(n, pn_Mod_res, value); } return n; -} /* transform_node_Mod */ +} /** * Transform a Cond node. @@ -2821,7 +2821,7 @@ static ir_node *transform_node_Cond(ir_node *n) clear_irg_state(irg, IR_GRAPH_STATE_NO_UNREACHABLE_CODE); } return n; -} /* transform_node_Cond */ +} /** * Prototype of a recursive transform function @@ -3360,7 +3360,7 @@ static ir_node *transform_node_And(ir_node *n) n = transform_node_bitop_shift(n); return n; -} /* transform_node_And */ +} /* the order of the values is important! */ typedef enum const_class { @@ -3461,7 +3461,7 @@ static ir_node *transform_node_Eor(ir_node *n) n = transform_node_bitop_shift(n); return n; -} /* transform_node_Eor */ +} /** * Transform a Not. @@ -3612,7 +3612,7 @@ static ir_node *transform_node_Minus(ir_node *n) } return n; -} /* transform_node_Minus */ +} /** * Transform a Proj(Load) with a non-null address. @@ -3644,7 +3644,7 @@ static ir_node *transform_node_Proj_Load(ir_node *proj) } } return proj; -} /* transform_node_Proj_Load */ +} /** * Transform a Proj(Store) with a non-null address. @@ -3676,7 +3676,7 @@ static ir_node *transform_node_Proj_Store(ir_node *proj) } } return proj; -} /* transform_node_Proj_Store */ +} /** * Transform a Proj(Div) with a non-zero value. @@ -3729,7 +3729,7 @@ static ir_node *transform_node_Proj_Div(ir_node *proj) } } return proj; -} /* transform_node_Proj_Div */ +} /** * Transform a Proj(Mod) with a non-zero value. @@ -3793,7 +3793,7 @@ static ir_node *transform_node_Proj_Mod(ir_node *proj) } } return proj; -} /* transform_node_Proj_Mod */ +} /** * Optimizes jump tables (CondIs or CondIu) by removing all impossible cases. @@ -4141,7 +4141,7 @@ static ir_node *transform_node_Cmp(ir_node *n) left = get_Eor_left(left); changed = true; } - } /* mode_is_int(...) */ + } } /* Cmp(And(1bit, val), 1bit) "bit-testing" can be replaced @@ -4361,8 +4361,8 @@ static ir_node *transform_node_Cmp(ir_node *n) } } } - } /* == or != */ - } /* mode_is_int */ + } + } if (relation == ir_relation_equal || relation == ir_relation_less_greater) { switch (get_irn_opcode(left)) { @@ -4523,9 +4523,9 @@ static ir_node *transform_node_Cmp(ir_node *n) DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_SHF_TO_AND); } break; - } /* switch */ + } } - } /* tarval != bad */ + } } if (changedc) { /* need a new Const */ @@ -4597,7 +4597,7 @@ static ir_node *transform_node_Proj_CopyB(ir_node *proj) } } return proj; -} /* transform_node_Proj_CopyB */ +} /** * Optimize Bounds(idx, idx, upper) into idx. @@ -4654,7 +4654,7 @@ static ir_node *transform_node_Proj_Bound(ir_node *proj) } } return proj; -} /* transform_node_Proj_Bound */ +} /** * Does all optimizations on nodes that must be done on its Projs @@ -4667,7 +4667,7 @@ static ir_node *transform_node_Proj(ir_node *proj) if (n->op->ops.transform_node_Proj) return n->op->ops.transform_node_Proj(proj); return proj; -} /* transform_node_Proj */ +} /** * Test whether a block is unreachable @@ -4830,7 +4830,7 @@ static void get_comm_Binop_Ops(ir_node *binop, ir_node **a, ir_node **c) *a = op_a; *c = op_b; } -} /* get_comm_Binop_Ops */ +} /** * Optimize a Or(And(Or(And(v,c4),c3),c2),c1) pattern if possible. @@ -4929,7 +4929,7 @@ static ir_node *transform_node_Or_bf_store(ir_node *irn_or) /* check for more */ } -} /* transform_node_Or_bf_store */ +} /** * Optimize an Or(shl(x, c), shr(x, bits - c)) into a Rotl @@ -5002,7 +5002,7 @@ static ir_node *transform_node_Or_Rotl(ir_node *irn_or) n = new_r_Rotl(block, x, c1, mode); DBG_OPT_ALGSIM0(irn_or, n, FS_OPT_OR_SHFT_TO_ROTL); return n; -} /* transform_node_Or_Rotl */ +} static bool is_cmp_unequal(const ir_node *node) { @@ -5134,7 +5134,7 @@ static ir_node *transform_node_Or(ir_node *n) } return n; -} /* transform_node_Or */ +} /* forward */ @@ -5440,7 +5440,7 @@ static ir_node *transform_node_Shr(ir_node *n) n = transform_node_shift_bitop(n); return n; -} /* transform_node_Shr */ +} /** * Transform a Shrs. @@ -5471,7 +5471,7 @@ static ir_node *transform_node_Shrs(ir_node *n) n = transform_node_shift_bitop(n); return n; -} /* transform_node_Shrs */ +} /** * Transform a Shl. @@ -5494,7 +5494,7 @@ static ir_node *transform_node_Shl(ir_node *n) n = transform_node_shift_bitop(n); return n; -} /* transform_node_Shl */ +} /** * Transform a Rotl. @@ -5513,7 +5513,7 @@ static ir_node *transform_node_Rotl(ir_node *n) n = transform_node_shift_bitop(n); return n; -} /* transform_node_Rotl */ +} /** * Transform a Conv. @@ -5567,7 +5567,7 @@ static ir_node *transform_node_Conv(ir_node *n) } return n; -} /* transform_node_Conv */ +} /** * Remove dead blocks and nodes in dead blocks @@ -5595,7 +5595,7 @@ static ir_node *transform_node_End(ir_node *n) if (j != n_keepalives) set_End_keepalives(n, j, in); return n; -} /* transform_node_End */ +} int ir_is_negated_value(const ir_node *a, const ir_node *b) { @@ -6139,7 +6139,7 @@ static ir_node *transform_node_Call(ir_node *call) if (get_irn_pinned(call) == op_pin_state_floats) set_irn_pinned(res, op_pin_state_floats); return res; -} /* transform_node_Call */ +} /** * Tries several [inplace] [optimizing] transformations and returns an @@ -6163,7 +6163,7 @@ static ir_node *transform_node(ir_node *n) } while (oldn != n); return n; -} /* transform_node */ +} /** * Sets the default transform node operation for an ir_op_ops. @@ -6228,7 +6228,7 @@ static ir_op_ops *firm_set_default_transform_node(ir_opcode code, ir_op_ops *ops #undef CASE_PROJ_EX #undef CASE_PROJ #undef CASE -} /* firm_set_default_transform_node */ +} /* **************** Common Subexpression Elimination **************** */ @@ -6524,7 +6524,7 @@ static ir_op_ops *firm_set_default_node_cmp_attr(ir_opcode code, ir_op_ops *ops) return ops; #undef CASE -} /* firm_set_default_node_cmp_attr */ +} /* * Compare function for two nodes in the value table. Gets two @@ -6592,7 +6592,7 @@ int identities_cmp(const void *elt, const void *key) return a->op->ops.node_cmp_attr(a, b); return 0; -} /* identities_cmp */ +} /* * Calculate a hash value of a node. @@ -6602,7 +6602,7 @@ int identities_cmp(const void *elt, const void *key) unsigned ir_node_hash(const ir_node *node) { return node->op->ops.hash(node); -} /* ir_node_hash */ +} void new_identities(ir_graph *irg) @@ -6610,13 +6610,13 @@ void new_identities(ir_graph *irg) if (irg->value_table != NULL) del_pset(irg->value_table); irg->value_table = new_pset(identities_cmp, N_IR_NODES); -} /* new_identities */ +} void del_identities(ir_graph *irg) { if (irg->value_table != NULL) del_pset(irg->value_table); -} /* del_identities */ +} /* Normalize a node by putting constants (and operands with larger * node index) on the right (operator side). */ @@ -6636,7 +6636,7 @@ void ir_normalize_node(ir_node *n) hook_normalize(n); } } -} /* ir_normalize_node */ +} /* * Return the canonical node computing the same value as n. @@ -6667,7 +6667,7 @@ ir_node *identify_remember(ir_node *n) } return nn; -} /* identify_remember */ +} /** * During construction we set the op_pin_state_pinned flag in the graph right @@ -6686,7 +6686,7 @@ static inline ir_node *identify_cons(ir_node *n) set_irg_pinned(irg, op_pin_state_floats); } return n; -} /* identify_cons */ +} /* Add a node to the identities value table. */ void add_identities(ir_node *node) @@ -6710,7 +6710,7 @@ void visit_all_identities(ir_graph *irg, irg_walk_func visit, void *env) visit(node, env); } current_ir_graph = rem; -} /* visit_all_identities */ +} /** * These optimizations deallocate nodes from the obstack. @@ -6808,7 +6808,7 @@ ir_node *optimize_node(ir_node *n) } return n; -} /* optimize_node */ +} /** @@ -6886,7 +6886,7 @@ ir_node *optimize_in_place_2(ir_node *n) } return n; -} /* optimize_in_place_2 */ +} /** * Wrapper for external use, set proper status bits after optimization. @@ -6904,7 +6904,7 @@ ir_node *optimize_in_place(ir_node *n) change the control graph. */ clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE); return optimize_in_place_2(n); -} /* optimize_in_place */ +} /** * Calculate a hash value of a Const node. @@ -6917,7 +6917,7 @@ static unsigned hash_Const(const ir_node *node) h = HASH_PTR(node->attr.con.tarval); return h; -} /* hash_Const */ +} /** * Calculate a hash value of a SymConst node. @@ -6930,7 +6930,7 @@ static unsigned hash_SymConst(const ir_node *node) h = HASH_PTR(node->attr.symc.sym.type_p); return h; -} /* hash_SymConst */ +} /** * Set the default hash operation in an ir_op_ops. @@ -6978,4 +6978,4 @@ ir_op_ops *firm_set_default_operations(unsigned code, ir_op_ops *ops) ops = firm_set_default_get_entity_attr(code, ops); return ops; -} /* firm_set_default_operations */ +} diff --git a/ir/ir/irpass.c b/ir/ir/irpass.c index 3626d2155..95186cb84 100644 --- a/ir/ir/irpass.c +++ b/ir/ir/irpass.c @@ -356,7 +356,7 @@ static int void_graph_wrapper(ir_graph *irg, void *context) void_pass_func_irg function = (void_pass_func_irg)context; function(irg); return 0; -} /* void_graph_wrapper */ +} /* Creates an ir_graph pass for running void function(ir_graph *irg). */ ir_graph_pass_t *def_graph_pass( @@ -372,7 +372,7 @@ ir_graph_pass_t *def_graph_pass( INIT_LIST_HEAD(&pass->list); return pass; -} /* def_graph_pass */ +} /** * Wrapper for running int function(ir_graph *irg) as an ir_graph pass. @@ -381,7 +381,7 @@ static int int_graph_wrapper(ir_graph *irg, void *context) { int_pass_func_irg function = (int_pass_func_irg)context; return function(irg); -} /* int_graph_wrapper */ +} /* Creates an ir_graph pass for running void function(ir_graph *irg). */ ir_graph_pass_t *def_graph_pass_ret( @@ -397,7 +397,7 @@ ir_graph_pass_t *def_graph_pass_ret( INIT_LIST_HEAD(&pass->list); return pass; -} /* def_graph_pass_ret */ +} /* constructor for a default graph pass */ ir_graph_pass_t *def_graph_pass_constructor( @@ -415,13 +415,13 @@ ir_graph_pass_t *def_graph_pass_constructor( INIT_LIST_HEAD(&pass->list); return pass; -} /* def_graph_pass_constructor */ +} /* set the run parallel property */ void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag) { pass->run_parallel = flag != 0; -} /* ir_graph_pass_set_parallel */ +} /** * Wrapper for running void function(void) as an ir_prog pass. @@ -433,7 +433,7 @@ static int void_prog_wrapper(ir_prog *irp, void *context) (void)irp; function(); return 0; -} /* void_graph_wrapper */ +} /* Creates an ir_prog pass for running void function(void). */ ir_prog_pass_t *def_prog_pass( @@ -450,7 +450,7 @@ ir_prog_pass_t *def_prog_pass( INIT_LIST_HEAD(&pass->list); return pass; -} /* def_prog_pass */ +} /* Creates an ir_prog pass for running void function(void). */ ir_prog_pass_t *def_prog_pass_constructor( @@ -471,7 +471,7 @@ ir_prog_pass_t *def_prog_pass_constructor( INIT_LIST_HEAD(&pass->list); return pass; -} /* def_prog_pass_constructor */ +} typedef struct pass_t { ir_prog_pass_t pass; @@ -489,7 +489,7 @@ static int call_function_wrapper(ir_prog *irp, void *context) (void)irp; pass->function(pass->context); return 0; -} /* call_function_wrapper */ +} ir_prog_pass_t *call_function_pass( const char *name, void (*function)(void *context), void *context) { @@ -506,4 +506,4 @@ ir_prog_pass_t *call_function_pass( pass->context = context; return &pass->pass; -} /* call_function_pass */ +} diff --git a/ir/tr/type_finalization.c b/ir/tr/type_finalization.c index 9e7f744a1..3367d0a8a 100644 --- a/ir/tr/type_finalization.c +++ b/ir/tr/type_finalization.c @@ -76,7 +76,7 @@ static void do_finalization(type_or_ent tore, void *env) get_compound_name(owner), get_entity_name(ent))); } } -} /* do_finalization */ +} /** * If we have the closed world assumption, we can calculate the diff --git a/ir/tv/strcalc.c b/ir/tv/strcalc.c index 2562ceab8..3e004125b 100644 --- a/ir/tv/strcalc.c +++ b/ir/tv/strcalc.c @@ -878,7 +878,7 @@ int sc_val_from_str(char sign, unsigned base, const char *str, /* get ready for the next letter */ str++; len--; - } /* while (len > 0 ) */ + } if (sign < 0) do_negate((const char*) buffer, (char*) buffer); -- 2.20.1