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

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

[r6931]
parent a490a493
......@@ -222,8 +222,6 @@ static int rta_fill_graph (ir_graph* graph)
}
/** Traverse all graphs to collect method accesses and object allocations.
*
* @param rerun Whether to rely on is_alive in a second run
*/
static int rta_fill_incremental (void)
{
......@@ -232,7 +230,7 @@ static int rta_fill_incremental (void)
int rerun = TRUE;
int old_ip_view = get_interprocedural_view();
set_interprocedural_view(false); /* save this for later */
set_interprocedural_view(0); /* save this for later */
/* init_tables has added main_irg to _live_graphs */
......@@ -535,6 +533,9 @@ void rta_report (void)
/*
* $Log$
* Revision 1.33 2005/11/17 17:26:57 beck
* removed bool type and depency from stdbool.h (not C89)
*
* Revision 1.32 2005/01/05 14:24:52 beck
* renames all is_x*_type() functions to is_X*_type() to prevent name clash with EDG frontend
*
......
......@@ -86,8 +86,8 @@ int dump_dominator_information_flag = 0;
int dump_loop_information_flag = 0;
int dump_backedge_information_flag = 1;
int dump_const_local = 0;
bool opt_dump_analysed_type_info = 1;
bool opt_dump_pointer_values_to_info = 0; /* default off: for test compares!! */
int opt_dump_analysed_type_info = 1;
int opt_dump_pointer_values_to_info = 0; /* default off: for test compares!! */
static dumper_colors overrule_nodecolor = ird_color_default;
......@@ -96,12 +96,12 @@ static DUMP_NODE_EDGE_FUNC dump_node_edge_hook = NULL;
void set_dump_node_edge_hook(DUMP_NODE_EDGE_FUNC func)
{
dump_node_edge_hook = func;
dump_node_edge_hook = func;
}
DUMP_NODE_EDGE_FUNC get_dump_node_edge_hook(void)
{
return dump_node_edge_hook;
return dump_node_edge_hook;
}
......@@ -125,11 +125,11 @@ void set_dump_edge_vcgattr_hook(DUMP_EDGE_VCGATTR_FUNC hook) {
dump_edge_vcgattr_hook = hook;
}
INLINE bool get_opt_dump_const_local(void) {
INLINE int get_opt_dump_const_local(void) {
if (!dump_out_edge_flag && !dump_loop_information_flag)
return dump_const_local;
else
return false;
return 0;
}
void only_dump_method_with_name(ident *name) {
......@@ -140,7 +140,7 @@ ident *get_dump_file_filter_ident(void) {
return dump_file_filter_id;
}
/** Returns true if dump file filter is not set, or if it is a
/** Returns non-zero if dump file filter is not set, or if it is a
* prefix of name. */
int is_filtered_dump_name(ident *name) {
if (!dump_file_filter_id) return 1;
......@@ -153,52 +153,52 @@ void turn_off_edge_labels(void) {
edge_label = 0;
}
void dump_consts_local(bool b) {
dump_const_local = b;
void dump_consts_local(int flag) {
dump_const_local = flag;
}
void dump_constant_entity_values(bool b) {
const_entities = b;
void dump_constant_entity_values(int flag) {
const_entities = flag;
}
void dump_keepalive_edges(bool b) {
dump_keepalive = b;
void dump_keepalive_edges(int flag) {
dump_keepalive = flag;
}
bool get_opt_dump_keepalive_edges(void) {
int get_opt_dump_keepalive_edges(void) {
return dump_keepalive;
}
void dump_out_edges(bool b) {
dump_out_edge_flag = b;
void dump_out_edges(int flag) {
dump_out_edge_flag = flag;
}
void dump_dominator_information(bool b) {
dump_dominator_information_flag = b;
void dump_dominator_information(int flag) {
dump_dominator_information_flag = flag;
}
void dump_loop_information(bool b) {
dump_loop_information_flag = b;
void dump_loop_information(int flag) {
dump_loop_information_flag = flag;
}
void dump_backedge_information(bool b) {
dump_backedge_information_flag = b;
void dump_backedge_information(int flag) {
dump_backedge_information_flag = flag;
}
/* Dump the information of type field specified in ana/irtypeinfo.h.
* If the flag is set, the type name is output in [] in the node label,
* else it is output as info.
*/
void set_opt_dump_analysed_type_info(bool b) {
opt_dump_analysed_type_info = b;
void set_opt_dump_analysed_type_info(int flag) {
opt_dump_analysed_type_info = flag;
}
void dump_pointer_values_to_info(bool b) {
opt_dump_pointer_values_to_info = b;
void dump_pointer_values_to_info(int flag) {
opt_dump_pointer_values_to_info = flag;
}
void dump_ld_names(bool b) {
dump_ld_name = b;
void dump_ld_names(int flag) {
dump_ld_name = flag;
}
/* -------------- some extended helper functions ----------------- */
......@@ -543,7 +543,7 @@ static ir_node **construct_block_lists(ir_graph *irg) {
irg_walk_graph(current_ir_graph, clear_link, collect_node, current_ir_graph);
/* Collect also EndReg and EndExcept. We do not want to change the walker. */
set_interprocedural_view(false);
set_interprocedural_view(0);
set_irg_visited(current_ir_graph, get_irg_visited(current_ir_graph)-1);
irg_walk(get_irg_end_reg(current_ir_graph), clear_link, collect_node, current_ir_graph);
......@@ -893,7 +893,7 @@ dump_node_nodeattr(FILE *F, ir_node *n)
switch (get_irn_opcode(n)) {
case iro_Start:
if (false && get_interprocedural_view()) {
if (0 && get_interprocedural_view()) {
fprintf (F, "%s ", get_ent_dump_name(get_irg_entity(current_ir_graph)));
}
break;
......@@ -1069,7 +1069,7 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
* checks whether a node is "constant-like" ie can be treated "block-less"
*/
static INLINE
bool is_constlike_node(ir_node *n) {
int is_constlike_node(ir_node *n) {
ir_op *op = get_irn_op(n);
return (op == op_Const || op == op_Bad || op == op_NoMem || op == op_SymConst || op == op_Unknown);
}
......@@ -1133,16 +1133,16 @@ static void dump_const_block_local(FILE *F, ir_node *n) {
PRINT_NODEID(n);
fprintf (F, "\" targetname: \""); PRINT_CONSTBLKID(n,blk);
if (dump_edge_vcgattr_hook) {
fprintf (F, "\" ");
if (dump_edge_vcgattr_hook) {
fprintf (F, "\" ");
if (dump_edge_vcgattr_hook(F, n, -1)) {
fprintf (F, "}\n");
return;
}
else {
else {
fprintf (F, " " BLOCK_EDGE_ATTR "}\n");
return;
}
return;
}
}
fprintf (F, "\" " BLOCK_EDGE_ATTR "}\n");
......@@ -1224,16 +1224,16 @@ dump_ir_block_edge(FILE *F, ir_node *n) {
fprintf (F, "\" targetname: ");
fprintf(F, "\""); PRINT_NODEID(block); fprintf(F, "\"");
if (dump_edge_vcgattr_hook) {
fprintf (F, " ");
if (dump_edge_vcgattr_hook) {
fprintf (F, " ");
if (dump_edge_vcgattr_hook(F, n, -1)) {
fprintf (F, "}\n");
return;
}
else {
else {
fprintf (F, " " BLOCK_EDGE_ATTR "}\n");
return;
}
return;
}
}
fprintf (F, " " BLOCK_EDGE_ATTR "}\n");
......@@ -1243,10 +1243,10 @@ dump_ir_block_edge(FILE *F, ir_node *n) {
static void
print_data_edge_vcgattr(FILE *F, ir_node *from, int to) {
/*
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
/*
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
fprintf (F, INTRA_DATA_EDGE_ATTR);
else
......@@ -1255,10 +1255,10 @@ print_data_edge_vcgattr(FILE *F, ir_node *from, int to) {
static void
print_mem_edge_vcgattr(FILE *F, ir_node *from, int to) {
/*
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
/*
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
fprintf (F, INTRA_MEM_EDGE_ATTR);
else
......@@ -1270,8 +1270,8 @@ print_edge_vcgattr(FILE *F, ir_node *from, int to) {
assert(from);
if (dump_edge_vcgattr_hook)
if (dump_edge_vcgattr_hook(F, from, to))
return;
if (dump_edge_vcgattr_hook(F, from, to))
return;
if (dump_backedge_information_flag && is_backedge(from, to))
fprintf (F, BACK_EDGE_ATTR);
......@@ -2603,7 +2603,7 @@ dump_cfg (ir_graph *irg, const char *suffix)
if (ipv) {
printf("Warning: dumping cfg not in interprocedural view!\n");
set_interprocedural_view(false);
set_interprocedural_view(0);
}
if (get_irg_dom_state(irg) != dom_consistent)
......@@ -2734,7 +2734,7 @@ void dump_all_cg_block_graph(const char *suffix) {
FILE *f;
int i;
int rem_view = get_interprocedural_view();
set_interprocedural_view(true);
set_interprocedural_view(1);
f = vcg_open_name("All_graphs", suffix);
dump_vcg_header(f, "All_graphs", NULL);
......@@ -2799,17 +2799,14 @@ dump_all_types (const char *suffix)
}
void
dump_class_hierarchy (bool entities, const char *suffix)
dump_class_hierarchy (int entities, const char *suffix)
{
FILE *f = vcg_open_name("class_hierarchy", suffix);
h_env_t env;
env.f = f;
env.f = f;
env.dump_ent = entities;
dump_vcg_header(f, "class_hierarchy", NULL);
if (entities)
env.dump_ent = 1;
else
env.dump_ent = 0;
type_walk(dump_class_hierarchy_node, NULL, &env);
vcg_close(f);
}
......
......@@ -383,7 +383,7 @@ void dump_all_types (const char *suffix);
* is dumped along with the entities.
* Dumps to a file class_hierarchy.vcg
*/
void dump_class_hierarchy (bool entities, const char *suffix);
void dump_class_hierarchy (int entities, const char *suffix);
/* **************************************************************************** */
/* LOOPTREE DUMPERS */
......@@ -461,12 +461,12 @@ void dump_graph_as_text(ir_graph *irg, const char *suffix);
/** Verbosity for text dumpers */
typedef enum {
dump_verbosity_onlynames = 0x00000001, /**< only dump names. turns off all other
flags up to 0x00010000. */
flags up to 0x00010000. */
dump_verbosity_fields = 0x00000002, /**< dump types and fields (like a type declaration) */
dump_verbosity_methods = 0x00000004, /**< dump types and methods (like a type declaration) */
dump_verbosity_nostatic = 0x00000040, /**< dump types and dynamic allocated fields (like a
type declaration). This excludes methods and
static, polymorphic fields. */
type declaration). This excludes methods and
static, polymorphic fields. */
dump_verbosity_typeattrs = 0x00000008, /**< dump all type attributes */
dump_verbosity_entattrs = 0x00000010, /**< dump all entity attributes */
dump_verbosity_entconsts = 0x00000020, /**< dump entity constants */
......@@ -493,9 +493,9 @@ typedef enum {
dump_verbosity_onlyEnumerationTypes=0x0007F000, /**< dump only enumeration types */
dump_verbosity_max = 0x4FF00FBE /**< turn on all verbosity.
Do not turn on negative flags!
@@@ Because of a bug in gcc 3.2 we can not set the
first two bits. */
Do not turn on negative flags!
@@@ Because of a bug in gcc 3.2 we can not set the
first two bits. */
} dump_verbosity;
......@@ -573,75 +573,75 @@ int is_filtered_dump_name(ident *name);
void turn_off_edge_labels(void);
/**
* If set to true constants will be replicated for every use. In non
* If set to non-zero constants will be replicated for every use. In non
* blocked view edges from constant to block are skipped. Vcg then
* layouts the graphs more compact, this makes them better readable.
* The flag is automatically and temporarily set to false if other
* edges are dumped, as outs, loop, ...
* Default setting: false.
*/
void dump_consts_local(bool b);
void dump_consts_local(int flag);
/**
* Returns false if dump_out_edge_flag or dump_loop_information_flag
* Returns 0 if dump_out_edge_flag or dump_loop_information_flag
* are set, else returns dump_const_local_flag.
*/
bool get_opt_dump_const_local(void);
int get_opt_dump_const_local(void);
/** Turns off dumping the values of constant entities. Makes type graphs
* better readable.
*/
void dump_constant_entity_values(bool b);
void dump_constant_entity_values(int flag);
/** Turns on dumping the edges from the End node to nodes to be kept
* alive.
*/
void dump_keepalive_edges(bool b);
bool get_opt_dump_keepalive_edges(void);
void dump_keepalive_edges(int flag);
int get_opt_dump_keepalive_edges(void);
/** Turns on dumping the out edges starting from the Start block in
* dump_ir_graph.
*
* To test the consistency of the out data structure.
*/
void dump_out_edges(bool b);
void dump_out_edges(int flag);
/** If this flag is set the dumper dumps edges to immediate dominator in cfg.
*/
void dump_dominator_information(bool b);
void dump_dominator_information(int flag);
/** If this flag is set the dumper dumps loop nodes and edges from
* these nodes to the contained ir nodes.
*
* If the loops are interprocedural nodes can be missing.
*/
void dump_loop_information(bool b);
void dump_loop_information(int flag);
/** If set and backedge info is computed, backedges are dumped dashed
* and as vcg 'backedge' construct.
*
* Default: set.
*/
void dump_backedge_information(bool b);
void dump_backedge_information(int flag);
/** Dump the information of type field specified in ana/irtypeinfo.h.
*
* If the flag is set, the type name is output in [] in the node label,
* else it is output as info.
*/
void set_opt_dump_analysed_type_info(bool b);
void set_opt_dump_analysed_type_info(int flag);
/** Write the address of a node into the vcg info.
*
* This is off per default for automatic comparisons of
* vcg graphs -- these will differ in the pointer values!
*/
void dump_pointer_values_to_info(bool b);
void dump_pointer_values_to_info(int flag);
/** Dumps ld_names of entities instead of there names.
*
* This option is on per default.
*/
void dump_ld_names(bool b);
void dump_ld_names(int flag);
# endif /* _IRDUMP_H_ */
......@@ -58,8 +58,8 @@
#define PRINT_EXTBBID(X) fprintf(F, "x%ld", get_irn_node_nr(X))
extern int dump_dominator_information_flag;
extern bool opt_dump_pointer_values_to_info;
extern bool opt_dump_analysed_type_info;
extern int opt_dump_pointer_values_to_info;
extern int opt_dump_analysed_type_info;
FILE *vcg_open (ir_graph *irg, const char * suffix1, const char *suffix2);
FILE *vcg_open_name (const char *name, const char *suffix);
......
......@@ -519,7 +519,7 @@ dead_node_elimination(ir_graph *irg) {
struct obstack *graveyard_obst = NULL;
struct obstack *rebirth_obst = NULL;
edges_init_graph(irg);
edges_init_graph(irg);
/* inform statistics that we started a dead-node elimination run */
hook_dead_node_elim(irg, 1);
......@@ -527,7 +527,7 @@ dead_node_elimination(ir_graph *irg) {
/* Remember external state of current_ir_graph. */
rem = current_ir_graph;
current_ir_graph = irg;
set_interprocedural_view(false);
set_interprocedural_view(0);
/* Handle graph state */
assert(get_irg_phase_state(current_ir_graph) != phase_building);
......@@ -603,9 +603,9 @@ static void relink_bad_block_predecessors(ir_node *n, void *env) {
for (i = 0; i < old_irn_arity; i++) {
irn = get_irn_n(n, i);
if (!is_Bad(irn)) {
new_in[new_irn_n] = irn;
is_backedge(n, i) ? set_backedge(n, new_irn_n-1) : set_not_backedge(n, new_irn_n-1);
new_irn_n++;
new_in[new_irn_n] = irn;
is_backedge(n, i) ? set_backedge(n, new_irn_n-1) : set_not_backedge(n, new_irn_n-1);
++new_irn_n;
}
}
//ARR_SETLEN(int, n->attr.block.backedge, new_irn_arity);
......@@ -650,9 +650,9 @@ static void relink_bad_predecessors(ir_node *n, void *env) {
new_irn_arity = 1;
for(i = 1; i < old_irn_arity; i++)
if (!is_Bad((ir_node *)old_in[i])) {
n->in[new_irn_arity] = n->in[i];
is_backedge(n, i) ? set_backedge(n, new_irn_arity) : set_not_backedge(n, new_irn_arity);
new_irn_arity++;
n->in[new_irn_arity] = n->in[i];
is_backedge(n, i) ? set_backedge(n, new_irn_arity) : set_not_backedge(n, new_irn_arity);
++new_irn_arity;
}
ARR_SETLEN(ir_node *, n->in, new_irn_arity);
......
......@@ -246,10 +246,10 @@ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
ir_graph * irg;
assert(get_irp_ip_view_state() == ip_view_valid);
set_interprocedural_view(false);
set_interprocedural_view(0);
eset_insert(irg_set, current_ir_graph);
irg_walk(node, (irg_walk_func *) collect_irgs, NULL, irg_set);
set_interprocedural_view(true);
set_interprocedural_view(1);
visited = get_max_irg_visited() + 1;
for (irg = eset_first(irg_set); irg; irg = eset_next(irg_set)) {
set_irg_visited(irg, visited);
......@@ -351,7 +351,7 @@ void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
ir_graph *rem = current_ir_graph;
int rem_view = get_interprocedural_view();
set_interprocedural_view(true);
set_interprocedural_view(1);
inc_max_irg_visited();
/* Fix all irg_visited flags */
......
......@@ -642,14 +642,14 @@ ir_node *
return _get_Block_cfgpred_block(node, pos);
}
bool
int
get_Block_matured (ir_node *node) {
assert (node->op == op_Block);
return node->attr.block.matured;
return (int)node->attr.block.matured;
}
void
set_Block_matured (ir_node *node, bool matured) {
set_Block_matured (ir_node *node, int matured) {
assert (node->op == op_Block);
node->attr.block.matured = matured;
}
......@@ -697,7 +697,7 @@ void set_Block_cg_cfgpred_arr(ir_node * node, int arity, ir_node ** in) {
/* Fix backedge array. fix_backedges() operates depending on
interprocedural_view. */
int ipv = get_interprocedural_view();
set_interprocedural_view(true);
set_interprocedural_view(1);
fix_backedges(current_ir_graph->obst, node);
set_interprocedural_view(ipv);
}
......@@ -1415,7 +1415,7 @@ int is_Cast_upcast(ir_node *node) {
assert(fromtype);
if (!is_Class_type(totype)) return false;
if (!is_Class_type(totype)) return 0;
return is_subclass_of(fromtype, totype);
}
......@@ -1437,7 +1437,7 @@ int is_Cast_downcast(ir_node *node) {
assert(fromtype);
if (!is_Class_type(totype)) return false;
if (!is_Class_type(totype)) return 0;
return is_subclass_of(totype, fromtype);
}
......
......@@ -267,7 +267,7 @@ ir_node *get_Block_cfgpred (ir_node *node, int pos);
void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred);
/** Get the predecessor block.
*
* Returns the block corresonding to the predecessor pos of block.
* Returns the block corresponding to the predecessor pos of block.
*
* There are several ambiguities we resolve with this function:
* - The direct predecessor can be a Proj, which is not pinned.
......@@ -277,8 +277,8 @@ void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred);
* Start, but the Bad node.
*/
ir_node *get_Block_cfgpred_block(ir_node *node, int pos);
bool get_Block_matured (ir_node *node);
void set_Block_matured (ir_node *node, bool matured);
int get_Block_matured (ir_node *node);
void set_Block_matured (ir_node *node, int matured);
/** A visited flag only for block nodes.
* @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/
......
......@@ -135,11 +135,11 @@ void add_irp_irg(ir_graph *irg) {
/* Removes irg from the list or irgs, shrinks the list by one. */
void remove_irp_irg_from_list(ir_graph *irg){
int i, found = false;
int i, found = 0;
assert(irg);
for (i = 0; i < (ARR_LEN (irp->graphs)); i++) {
if (irp->graphs[i] == irg) {
found = true;
found = 1;
for(; i < (ARR_LEN (irp->graphs)) - 1; i++) {
irp->graphs[i] = irp->graphs[i+1];
}
......@@ -177,23 +177,23 @@ ir_graph *(get_irp_irg)(int pos){
void set_irp_irg(int pos, ir_graph *irg) {
assert (irp && irg);
assert (pos < (ARR_LEN((irp)->graphs)));
assert (pos < (ARR_LEN(irp->graphs)));
irp->graphs[pos] = irg;
}
/* Gets the number of graphs _and_ pseudo graphs. */
int get_irp_n_allirgs(void) {
/* We can not call get_irp_n_irgs, as we end up in a recursion ... */
return ARR_LEN((irp)->graphs) + get_irp_n_pseudo_irgs();
return ARR_LEN(irp->graphs) + get_irp_n_pseudo_irgs();
}
/* Returns the ir graph at position pos of all graphs (including
pseudo graphs). Visits first graphs, then pseudo graphs. */
ir_graph *get_irp_allirg(int pos) {
int n_irgs = ARR_LEN((irp)->graphs);
int n_irgs = ARR_LEN(irp->graphs);
assert(0 <= pos);
if (pos < n_irgs) {
return (irp)->graphs[pos];
return irp->graphs[pos];
} else {
return get_irp_pseudo_irg(pos-n_irgs);
}
......
......@@ -64,7 +64,7 @@ typedef struct {
typedef struct {
opcode opc;
const char *name;
bool commutative;
int commutative;
int sig_count;
rflct_arg_t *sigs[MAX_SIG_COUNT];
} rflct_opcode_t;
......@@ -326,23 +326,26 @@ char *rflct_to_string(char *buf, int n, opcode opc, int sig) {
return buf;
}
#define NON_VARIADIC 0
#define VARIADIC 1
#define ARG(name,modes) \
_ARG(name, modes, false, -1)
_ARG(name, modes, NON_VARIADIC, -1)
#define ARG_SAME(name,modes,mode_same) \