Commit 5ea9d0c9 authored by Michael Beck's avatar Michael Beck
Browse files

removed bool type and depency from stdbool.h (not C89)

[r6925]
parent 46fef928
......@@ -360,7 +360,7 @@ static int current_dfn = 1; /**< Counter to generate depth first numberin
/**********************************************************************/
typedef struct scc_info {
bool in_stack; /**< Marks whether node is on the stack. */
int in_stack; /**< Marks whether node is on the stack. */
int dfn; /**< Depth first search number. */
int uplink; /**< dfn number of ancestor. */
int visited;
......@@ -403,17 +403,17 @@ static INLINE void
mark_irg_in_stack (ir_graph *n) {
scc_info *info = get_irg_link(n);
assert(info);
info->in_stack = true;
info->in_stack = 1;
}
static INLINE void
mark_irg_not_in_stack (ir_graph *n) {
scc_info *info = get_irg_link(n);
assert(info);
info->in_stack = false;
info->in_stack = 0;
}
static INLINE bool
static INLINE int
irg_is_in_stack (ir_graph *n) {
scc_info *info = get_irg_link(n);
assert(info);
......@@ -615,12 +615,12 @@ init_scc (void) {
}
}
/** Returns true if n is a loop header, i.e., it is a Block node
/** Returns non-zero if n is a loop header, i.e., it is a Block node
* and has predecessors within the cfloop and out of the cfloop.
*
* @param root: only needed for assertion.
*/
static bool
static int
is_head (ir_graph *n, ir_graph *root)
{
int i, arity;
......@@ -645,12 +645,12 @@ is_head (ir_graph *n, ir_graph *root)
}
/**
* Returns true if n is possible loop head of an endless loop.
* Returns non-zero if n is possible loop head of an endless loop.
* I.e., it is a Block, Phi or Filter node and has only predecessors
* within the loop.
* @arg root: only needed for assertion.
*/
static bool
static int
is_endless_head (ir_graph *n, ir_graph *root)
{
int i, arity;
......@@ -680,12 +680,12 @@ is_endless_head (ir_graph *n, ir_graph *root)
* Check whether there is a parallel edge in the ip control flow.
* Only
*/
static bool
static int
is_ip_head (ir_graph *n, ir_graph *pred)
{
int is_be = 0;
int iv_rem = get_interprocedural_view();
set_interprocedural_view(true);
set_interprocedural_view(1);
{
ir_node *sblock = get_irg_start_block(n);
int i, arity = get_Block_n_cfgpreds(sblock);
......@@ -702,7 +702,7 @@ is_ip_head (ir_graph *n, ir_graph *pred)
//printf(" "); DDMG(ip_pred);
if ((ip_pred == pred) && is_backedge(sblock, i)) {
//printf(" found\n");
is_be = 1;
is_be = 1;
}
}
}
......
......@@ -81,7 +81,7 @@ static entity *get_inherited_methods_implementation(entity *inh_meth) {
}
/** Collect the entity representing the implementation of this
* entity (not the same if inherited) and all entities for overwriting
* method (not the same if inherited) and all entities for overwriting
* implementations in "set".
* If the implementation of the method is not included in the
* compilation unit "open" is set to true.
......@@ -93,7 +93,7 @@ static entity *get_inherited_methods_implementation(entity *inh_meth) {
* @param size Number of entities in set.
* @param open
*/
static void collect_impls(entity *method, eset *set, int *size, bool *open) {
static void collect_impls(entity *method, eset *set, int *size, int *open) {
int i;
entity *impl;
......@@ -127,7 +127,7 @@ static entity ** get_impl_methods(entity * method) {
eset * set = eset_create();
int size = 0;
entity ** arr;
bool open = false;
int open = 0;
/* Collect all method entities that can be called here */
collect_impls(method, set, &size, &open);
......
......@@ -278,7 +278,7 @@ int is_fragile_Proj(ir_node *n) {
static double exception_prob = 0.001;
static INLINE int is_loop_head(ir_node *cond) {
return false;
return 0;
}
/** Weight a single region in edge.
......
......@@ -112,15 +112,15 @@ static INLINE void exc_outs(void *reg, ir_node *cfop) {
/* Walk a loop and add all edges. Walk inner loops by recursion. */
/*------------------------------------------------------------------*/
/* return true if outer can be reached from inner via the outer loop relation */
/* return non-zero if outer can be reached from inner via the outer loop relation */
static int find_outer_loop(ir_loop *inner, ir_loop *outer, ir_node *b, ir_node *cfop) {
if (get_loop_outer_loop(inner) == outer) {
add_region_in(inner, b);
add_loop_cfop(inner, cfop);
exc_outs(b, cfop);
return true;
return 1;
}
return false;
return 0;
}
static int test_loop_nest(ir_node *pred_b, ir_loop *nest) {
......@@ -130,34 +130,34 @@ static int test_loop_nest(ir_node *pred_b, ir_loop *nest) {
loop_element e = get_loop_element(nest, i);
switch (*e.kind) {
case k_ir_node: {
if (e.node == pred_b) return true;
if (e.node == pred_b) return 1;
} break;
case k_ir_loop: {
if (test_loop_nest(pred_b, e.son)) return true;
if (test_loop_nest(pred_b, e.son)) return 1;
} break;
default: break;
}
}
return false;
return 0;
}
static int find_inner_loop(ir_node *b, ir_loop *l, ir_node *pred, ir_node *cfop) {
int i, n_elems = get_loop_n_elements(l);
int found = false;
int found = 0;
for (i = 0; (i < n_elems) && !found; ++i) {
loop_element e = get_loop_element(l, i);
switch (*e.kind) {
case k_ir_node: {
if (e.node == b) return false;
if (e.node == b) return 0;
} break;
case k_ir_loop: {
found = test_loop_nest(pred, e.son);
if (found) {
add_region_in(b, e.son);
exc_outs(e.son, cfop);
//if (is_fragile_op(cfop)) inc_region_n_exc_outs(b);
return found;
add_region_in(b, e.son);
exc_outs(e.son, cfop);
//if (is_fragile_op(cfop)) inc_region_n_exc_outs(b);
return found;
}
} break;
default: break;
......@@ -174,16 +174,16 @@ static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, ir_node *
assert(l_pos > -1);
assert(l_pos > 0 && "Is this a necessary condition? There could be a perfect nest ...");
for (i = l_pos -1, found = false; i > -1 && !found; --i) {
for (i = l_pos -1, found = 0; i > -1 && !found; --i) {
ir_loop *k = get_loop_element(outer, i).son;
if (is_ir_loop(k)) {
found = test_loop_nest(pred_b, k);
if (found) {
add_region_in(l, k);
//if (is_fragile_op(cfop)) inc_region_n_exc_outs(k);
exc_outs(k, cfop);
add_loop_cfop(l, cfop);
add_region_in(b, NULL);
add_region_in(l, k);
//if (is_fragile_op(cfop)) inc_region_n_exc_outs(k);
exc_outs(k, cfop);
add_loop_cfop(l, cfop);
add_region_in(b, NULL);
}
}
}
......@@ -200,9 +200,10 @@ static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, ir_node *
}
/* Compute the edges for the interval graph.
/**
* Compute the edges for the interval graph.
*
* @param b The block for which to constuct the edges.
* @param b The block for which to construct the edges.
* @param l The loop of b.
*
* There are four cases:
......@@ -240,9 +241,9 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
cfop = get_Block_cfgpred(b, i);
if (is_Proj(cfop)) {
if (get_irn_op(get_Proj_pred(cfop)) != op_Cond) {
cfop = skip_Proj(cfop);
cfop = skip_Proj(cfop);
} else {
assert(get_nodes_block(cfop) == get_nodes_block(skip_Proj(cfop)));
assert(get_nodes_block(cfop) == get_nodes_block(skip_Proj(cfop)));
}
}
......@@ -348,9 +349,9 @@ void dump_region_edges(FILE *F, void *reg) {
if (is_ir_node(reg) && get_Block_n_cfgpreds((ir_node *)reg) > get_region_n_ins(reg)) {
for (i = n_ins; i < get_Block_n_cfgpreds((ir_node *)reg); ++i) {
if (is_backedge((ir_node *)reg, i))
fprintf (F, "backedge: { sourcename: \"");
fprintf (F, "backedge: { sourcename: \"");
else
fprintf (F, "edge: { sourcename: \"");
fprintf (F, "edge: { sourcename: \"");
PRINT_NODEID(((ir_node *)reg));
fprintf (F, "\" targetname: \"");
PRINT_NODEID(get_nodes_block(skip_Proj(get_Block_cfgpred((ir_node *)reg, i))));
......@@ -363,17 +364,17 @@ void dump_region_edges(FILE *F, void *reg) {
if (is_ir_node(reg)) {
if (get_Block_n_cfgpreds((ir_node *)reg) != get_region_n_ins(reg)) {
printf("n_cfgpreds = %d, n_ins = %d\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg));
DDMN((ir_node *)reg);
printf("n_cfgpreds = %d, n_ins = %d\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg));
DDMN((ir_node *)reg);
}
}
if ((!target || (is_ir_node(reg) && !is_ir_node(target))) && i < get_Block_n_cfgpreds((ir_node *)reg)) {
assert(is_ir_node(reg));
if (is_backedge((ir_node *)reg, i))
fprintf (F, "backedge: { sourcename: \"");
fprintf (F, "backedge: { sourcename: \"");
else
fprintf (F, "edge: { sourcename: \"");
fprintf (F, "edge: { sourcename: \"");
PRINT_NODEID(((ir_node *)reg));
fprintf (F, "\" targetname: \"");
PRINT_NODEID(get_nodes_block(skip_Proj(get_Block_cfgpred((ir_node *)reg, i))));
......@@ -429,7 +430,7 @@ void dump_interval_block(FILE *F, ir_node *block) {
ir_node *pred = get_Block_cfgpred(block, i);
if (is_Bad(pred)) {
if (! fl)
fprintf(F, "Bad pred at pos: ");
fprintf(F, "Bad pred at pos: ");
fprintf(F, "%d ", i);
fl = 1;
}
......
......@@ -71,14 +71,14 @@ static INLINE int *get_backarray(ir_node *n) {
}
/**
* Returns true if node has no backarray, or
* if size of backarray == size of in array.
* Returns nin-zero if node has no backarray, or
* if size of backarray == size of in array.
*/
static INLINE bool legal_backarray (ir_node *n) {
static INLINE int legal_backarray (ir_node *n) {
int *ba = mere_get_backarray(n);
if (ba && (ARR_LEN(ba) != ARR_LEN(get_irn_in(n))-1)) /* Use get_irn_in -- sensitive to view! */
return false;
return true;
return 0;
return 1;
}
......@@ -133,37 +133,37 @@ int is_intra_backedge(ir_node *n, int pos) {
}
/** Returns true if the predecessor pos is a backedge. */
bool is_backedge (ir_node *n, int pos) {
/* Returns non-zero if the predecessor pos is a backedge. */
int is_backedge (ir_node *n, int pos) {
int *ba = get_backarray (n);
if (ba) return ba[pos];
return false;
return 0;
}
/** Remarks that edge pos is a backedge. */
/* Remarks that edge pos is a backedge. */
void set_backedge (ir_node *n, int pos) {
int *ba = get_backarray (n);
assert(ba && "can only set backedges at Phi, Filter, Block nodes.");
ba[pos] = 1;
}
/** Remarks that edge pos is a backedge. */
/* Remarks that edge pos is a backedge. */
void set_not_backedge (ir_node *n, int pos) {
int *ba = get_backarray (n);
assert(ba && "can only set backedges at Phi, Filter, Block nodes.");
ba[pos] = 0;
}
/** Returns true if n has backedges. */
bool has_backedges (ir_node *n) {
/* Returns non-zero if n has backedges. */
int has_backedges (ir_node *n) {
int i;
int *ba = get_backarray (n);
if (ba) {
int arity = get_irn_arity(n);
for (i = 0; i < arity; i++)
if (ba[i]) return true;
if (ba[i]) return 1;
}
return false;
return 0;
}
/** Sets all backedge information to zero. */
......@@ -171,14 +171,14 @@ void clear_backedges (ir_node *n) {
int i, arity;
int rem = get_interprocedural_view();
int *ba;
set_interprocedural_view(false);
set_interprocedural_view(0);
ba = get_backarray (n);
if (ba) {
arity = get_irn_arity(n);
for (i = 0; i < arity; i++)
ba[i] = 0;
}
set_interprocedural_view(true);
set_interprocedural_view(1);
ba = get_backarray (n);
if (ba) {
arity = get_irn_arity(n);
......
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