}
/** 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)
{
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 */
/*
* $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
*
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;
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;
}
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) {
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;
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 ----------------- */
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);
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;
* 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);
}
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");
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");
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
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
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);
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)
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);
}
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);
}
* 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 */
/** 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 */
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;
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_ */
#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);
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);
/* 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);
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);
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);
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);
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 */
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;
}
/* 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);
}
assert(fromtype);
- if (!is_Class_type(totype)) return false;
+ if (!is_Class_type(totype)) return 0;
return is_subclass_of(fromtype, totype);
}
assert(fromtype);
- if (!is_Class_type(totype)) return false;
+ if (!is_Class_type(totype)) return 0;
return is_subclass_of(totype, fromtype);
}
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.
* 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()*/
/* 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];
}
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);
}
typedef struct {
opcode opc;
const char *name;
- bool commutative;
+ int commutative;
int sig_count;
rflct_arg_t *sigs[MAX_SIG_COUNT];
} rflct_opcode_t;
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) \
-_ARG(name, modes, false, mode_same)
+_ARG(name, modes, NON_VARIADIC, mode_same)
#define VARG(name,modes) \
-_ARG(name, modes, true, 0)
+_ARG(name, modes, VARIADIC, 0)
#define VARG_SAME(name,modes) \
-_ARG(name, modes, true, 1)
+_ARG(name, modes, VARIADIC, 1)
#define MARK \
-_ARG(NULL, None, false, -1)
+_ARG(NULL, None, NON_VARIADIC, -1)
#define FINISH \
-_ARG(NULL, None, false, 0)
+_ARG(NULL, None, NON_VARIADIC, 0)
#define BLOCK ARG("Block", BB)
arg->is_variadic = _var; \
arg->mode_equals = _me;
-void rflct_new_opcode(opcode opc, const char *name, bool commutative)
+void rflct_new_opcode(opcode opc, const char *name, int commutative)
{
rflct_opcode_t *ropc = obstack_alloc(&obst, sizeof(*ropc));
opcodes[opc] = ropc;
}
-bool rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig)
+int rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig)
{
rflct_arg_t *args = sig->args;
rflct_opcode_t *op = opcodes[opc];
for(i = 0; i < MAX_SIG_COUNT && op->sigs[i] != NULL; i++);
if(i >= MAX_SIG_COUNT)
- return false;
+ return 0;
op->sigs[op->sig_count++] = args;
free(sig);
- return true;
+ return 1;
}
return sig;
}
-int rflct_signature_get_index(const rflct_sig_t *sig, bool is_use, int num)
+int rflct_signature_get_index(const rflct_sig_t *sig, int is_use, int num)
{
return is_use ? num + sig->defs + 1 : num;
}
arg->is_variadic = _var; \
arg->mode_equals = _me;
-int rflct_signature_set_arg(rflct_sig_t *sig, bool is_use, int num,
- const char *name, rflct_mode_class_t mc, bool is_variadic, int mode_equals)
+int rflct_signature_set_arg(rflct_sig_t *sig, int is_use, int num,
+ const char *name, rflct_mode_class_t mc, int is_variadic, int mode_equals)
{
int index = rflct_signature_get_index(sig, is_use, num);
rflct_arg_t *arg = sig->args + index;
void firm_init_rflct(void) {
init_ops();
}
+
+#undef VARIADIC
+#undef NON_VARIADIC
#define _FIRM_REFLECT_H
#include <limits.h>
-#include <stdbool.h>
#include "irop.h"
#include "irnode.h"
typedef struct _rflct_arg_t {
const char *name; /**< The name of the argument (just a description). */
- bool is_variadic; /**< True, if this argument can have multiple parameters. */
+ int is_variadic; /**< non-zero, if this argument can have multiple parameters. */
rflct_mode_class_t accepted_modes; /**< The set of accepted modes. */
int mode_equals; /**< If not variadic: You can specify the index of
/**
* Create a new opcode.
- * @param opc The Firm opcode.
- * @param name A name.
- * @param commutative True, if the opcode is commuatative.
+ * @param opc The Firm opcode.
+ * @param name A name.
+ * @param commutative non-zero, if the opcode is commutative.
*/
-void rflct_new_opcode(opcode opc, const char *name, bool commutative);
+void rflct_new_opcode(opcode opc, const char *name, int commutative);
/**
* Add a signature to the opcode.
* @param opc The opcode.
* @param sig The signature.
- * @return true, if the signature was added sucessfully, false if no
+ * @return non-zero, if the signature was added successfully, false if no
* more signatures can be added to the opcode.
*/
-bool rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig);
+int rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig);
/**
* Allocate a new signature.
/**
* Set an argument in a signature.
- * @param sig The signature.
- * @param is_use true, if the argument is a use, else it is considered a
- * def.
- * @param num The index of the argument.
- * @param name The name of the argument.
- * @param mc The mode class of the argument.
- * @param is_variadic true, if the argument is variadic.
+ *
+ * @param sig The signature.
+ * @param is_use non-zero, if the argument is a use, else it is
+ * considered a def.
+ * @param num The index of the argument.
+ * @param name The name of the argument.
+ * @param mc The mode class of the argument.
+ * @param is_variadic non-zero, if the argument is variadic.
* @param mode_equals This variable has following meaning: If the
* argument is variadic, a 1 indicates that all operands binding to this
* argument must have the same mode. A 0 indicates, that their mode must
* @return The index of the argument. Only use this index in mode_equals
* parameters of other arguments.
*/
-int rflct_signature_set_arg(rflct_sig_t *sig, bool is_use, int num,
- const char *name, rflct_mode_class_t mc, bool is_variadic, int mode_equals);
+int rflct_signature_set_arg(rflct_sig_t *sig, int is_use, int num,
+ const char *name, rflct_mode_class_t mc, int is_variadic, int mode_equals);
/**
* Get the arguments array index for an argument.
- * @param sig The signature.
- * @param is_use True, if the argument indicates a use or def argument.
- * @param num The number of the argument.
+ * @param sig The signature.
+ * @param is_use non-zero, if the argument indicates a use or def argument.
+ * @param num The number of the argument.
* @return The index into the arguments array.
*/
-int rflct_signature_get_index(const rflct_sig_t *sig, bool is_use, int num);
+int rflct_signature_get_index(const rflct_sig_t *sig, int is_use, int num);
#endif /* _FIRM_REFLECT_H */
return res;
}
-/* Returns true ir ir_graph is pseudo graph. */
+/* Returns non-zero ir ir_graph is pseudo graph. */
int is_pseudo_ir_graph(ir_graph *irg)
{
int i, n_pseudo_irgs;
n_pseudo_irgs = get_irp_n_pseudo_irgs();
for (i = 0; i < n_pseudo_irgs; ++i) {
- if (irg == get_irp_pseudo_irg(i)) return true;
+ if (irg == get_irp_pseudo_irg(i)) return 1;
}
- return false;
+ return 0;
}
static int visit_pseudo_irgs = 0;
*/
ir_graph *new_pseudo_ir_graph(entity *ent, int n_loc);
-/** Returns true ir ir_graph is pseudo graph.
+/** Returns non-zero ir ir_graph is pseudo graph.
* Is irg a pseudo graph for analysis? */
int is_pseudo_ir_graph(ir_graph *irg);
ir_node *nn;
int new_arity;
ir_op *op = get_irn_op(n);
- int copy_node_nr = false;
+ int copy_node_nr = 0;
/* The end node looses it's flexible in array. This doesn't matter,
as dead node elimination builds End by hand, inlineing doesn't use
case iro_Const:
case iro_SymConst:
case iro_Unknown:
- return true; break;
+ return 1;
case iro_Conv:
case iro_Cast:
return is_irn_const_expression(get_irn_n(n, 0));
default:
- return false;
break;
}
- return false;
+ return 0;
}
/*
node = get_compound_graph_path_node(gr, i);
if (node == NULL)
/* Path not yet complete. */
- return true;
+ return 1;
if (get_entity_owner(node) != owner)
- return false;
+ return 0;
owner = get_entity_type(node);
}
if (pos == get_compound_graph_path_length(gr))
if (!is_atomic_type(owner))
- return false;
- return true;
+ return 0;
+ return 1;
}
/* Returns the length of a graph path */
int len1 = get_compound_graph_path_length(path1);
int len2 = get_compound_graph_path_length(path2);
- if (len2 > len1) return false;
+ if (len2 > len1) return 0;
for (i = 0; i < len1; i++) {
type *tp;
entity *node1 = get_compound_graph_path_node(path1, i);
entity *node2 = get_compound_graph_path_node(path2, i);
- if (node1 != node2) return false;
+ if (node1 != node2) return 0;
tp = get_entity_owner(node1);
if (is_Array_type(tp)) {
low = get_array_lower_bound_int(tp, 0);
if (low + visited_indicees[i] < get_compound_graph_path_array_index(path2, i)) {
visited_indicees[i]++;
- return false;
+ return 0;
}
else
assert(low + visited_indicees[i] == get_compound_graph_path_array_index(path2, i));
}
}
- return true;
+ return 1;
}
/* Returns the position of a value with the given path.
/**
* @todo not implemented!!! */
-bool equal_entity(entity *ent1, entity *ent2) {
+int equal_entity(entity *ent1, entity *ent2) {
fprintf(stderr, " calling unimplemented equal entity!!! \n");
- return true;
+ return 1;
}
void set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index);
/** Checks whether the path up to pos is correct. If the path contains a NULL,
- * assumes the path is not complete and returns 'true'. */
+ * assumes the path is not complete and returns non-zero. */
int is_proper_compound_graph_path(compound_graph_path *gr, int pos);
/* A value of a compound entity is a pair of a value and the description of the
- they have the same type (the same C-struct)
- ...?
*/
-bool equal_entity(entity *ent1, entity *ent2);
+int equal_entity(entity *ent1, entity *ent2);
/** Outputs a unique number for this entity if libfirm is compiled for
debugging, (configure with --enable-debug) else returns 0. */
type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
int j, n_subtypes = get_class_n_subtypes(tp);
- int has_unmarked_subtype = false;
+ int has_unmarked_subtype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
- for (j = 0; j < n_subtypes && !has_unmarked_subtype; ++j) {
+ for (j = 0; j < n_subtypes; ++j) {
type *stp = get_class_subtype(tp, j);
- if (type_not_visited(stp)) has_unmarked_subtype = true;
+ if (type_not_visited(stp)) {
+ has_unmarked_subtype = 1;
+ break;
+ }
}
/* This is a good starting point. */
type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
int j, n_supertypes = get_class_n_supertypes(tp);
- int has_unmarked_supertype = false;
+ int has_unmarked_supertype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
- for (j = 0; j < n_supertypes && !has_unmarked_supertype; ++j) {
+ for (j = 0; j < n_supertypes; ++j) {
type *stp = get_class_supertype(tp, j);
- if (type_not_visited(stp)) has_unmarked_supertype = true;
+ if (type_not_visited(stp)) {
+ has_unmarked_supertype = 1;
+ break;
+ }
}
/* This is a good starting point. */
entity *ovw = get_entity_overwrites(mem, j);
/*printf(" overwrites: "); DDME(ovw);*/
/* Check whether ovw is member of one of tp's supertypes. If so,
- the representation is correct. */
- found = false;
+ the representation is correct. */
+ found = 0;
for (k = 0; k < get_class_n_supertypes(tp); k++) {
- if (get_class_member_index(get_class_supertype(tp, k), ovw) >= 0) {
- found = true;
- break;
- }
+ if (get_class_member_index(get_class_supertype(tp, k), ovw) >= 0) {
+ found = 0;
+ break;
+ }
}
if (!found) {
- DDMT(tp); DDME(mem);
- assert(found && "overwrites an entity not contained in direct supertype");
- return error_ent_not_cont;
+ DDMT(tp); DDME(mem);
+ assert(found && "overwrites an entity not contained in direct supertype");
+ return error_ent_not_cont;
}
}
# ifndef _TYPE_H_
# define _TYPE_H_
-#include <stdbool.h>
-
# include "firm_types.h"
# include "tpop.h"
# include "firm_common.h"