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

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.
parent 49dda300
......@@ -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");
}
......
......@@ -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 */
}
......@@ -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 */
}
......@@ -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");
}
......
......@@ -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 = {
......
......@@ -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 */