Commit d27135fe authored by Michael Beck's avatar Michael Beck
Browse files

- indentation

- cleanup

[r25782]
parent 2ece936d
......@@ -68,37 +68,34 @@ ir_type *initial_type = NULL;
* in the order of MIN(<calls to set_irn_type>, #irnodes).
*/
void init_irtypeinfo(void) {
int i, n;
int i;
if (!initial_type)
if (initial_type == NULL)
initial_type = new_type_class(new_id_from_str("initial_type"));
/* We need a new, empty map. */
if (type_node_map) pmap_destroy(type_node_map);
if (type_node_map != NULL)
pmap_destroy(type_node_map);
type_node_map = pmap_create();
n = get_irp_n_irgs();
for (i = 0; i < n; ++i)
for (i = get_irp_n_irgs() - 1; i >= 0; --i)
set_irg_typeinfo_state(get_irp_irg(i), ir_typeinfo_none);
}
void free_irtypeinfo(void) {
int i, n;
int i;
if (initial_type) {
if (initial_type != NULL) {
free_type(initial_type);
initial_type = NULL;
}
//else assert(0 && "call init_type_info before freeing");
if (type_node_map) {
if (type_node_map != NULL) {
pmap_destroy(type_node_map);
type_node_map = NULL;
}
//else assert(0 && "call init_type_info before freeing");
n = get_irp_n_irgs();
for (i = 0; i < n; ++i)
for (i = get_irp_n_irgs() - 1; i >= 0; --i)
set_irg_typeinfo_state(get_irp_irg(i), ir_typeinfo_none);
}
......@@ -148,19 +145,18 @@ void set_irp_typeinfo_inconsistent(void) {
ir_type *get_irn_typeinfo_type(const ir_node *n) {
ir_type *res = initial_type;
pmap_entry *entry;
assert(get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_inconsistent );
assert(get_irg_typeinfo_state(get_irn_irg(n)) != ir_typeinfo_none);
entry = pmap_find(type_node_map, n);
if (entry)
if (entry != NULL)
res = entry->value;
return res;
}
void set_irn_typeinfo_type(ir_node *n, ir_type *tp) {
assert(get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_inconsistent );
assert(get_irg_typeinfo_state(current_ir_graph) != ir_typeinfo_none);
pmap_insert(type_node_map, (void *)n, (void *)tp);
}
Supports Markdown
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