Commit 86e761ab authored by Michael Beck's avatar Michael Beck
Browse files

- all visited flags use the ir_visited_t type now

[r22180]
parent 8949bb0b
......@@ -82,14 +82,14 @@ ir_extblk *get_nodes_extbb(ir_node *node);
*
* @param blk the extended basic block
*/
unsigned long get_extbb_visited(const ir_extblk *blk);
ir_visited_t get_extbb_visited(const ir_extblk *blk);
/**
* Sets the visited counter of an extended block.
*
* @param blk the extended basic block
*/
void set_extbb_visited(ir_extblk *blk, unsigned long visited);
void set_extbb_visited(ir_extblk *blk, ir_visited_t visited);
/**
* Mark an extended block as visited in a graph.
......
......@@ -491,20 +491,20 @@ void *get_irg_link (const ir_graph *irg);
/** Increments visited flag by one.
* @see also: get_irn_visited() get_irg_block_visited(). */
void inc_irg_visited(ir_graph *irg);
unsigned long get_irg_visited(const ir_graph *irg);
void set_irg_visited(ir_graph *irg, unsigned long i);
void inc_irg_visited(ir_graph *irg);
ir_visited_t get_irg_visited(const ir_graph *irg);
void set_irg_visited(ir_graph *irg, ir_visited_t i);
/** An interprocedural flag valid for all irgs.
* @see also: get_irn_visited() get_irg_block_visited(). */
unsigned long get_max_irg_visited(void);
void set_max_irg_visited(int val);
unsigned long inc_max_irg_visited(void);
ir_visited_t get_max_irg_visited(void);
void set_max_irg_visited(int val);
ir_visited_t inc_max_irg_visited(void);
/** Increments block_visited by one.
* @see also: get_irn_visited() get_irg_block_visited(). */
void inc_irg_block_visited(ir_graph *irg);
unsigned long get_irg_block_visited(const ir_graph *irg);
void set_irg_block_visited(ir_graph *irg, unsigned long i);
void inc_irg_block_visited(ir_graph *irg);
ir_visited_t get_irg_block_visited(const ir_graph *irg);
void set_irg_block_visited(ir_graph *irg, ir_visited_t i);
/**
* Debug helpers: You can indicate whether you are currently using visited or
......
......@@ -204,9 +204,9 @@ ident *get_irn_opident(const ir_node *node);
/** If arg is an argument of the node, returns it's position, -1 otherwise */
int get_irn_pred_pos(ir_node *node, ir_node *arg);
/** Gets the visited counter of a node. */
unsigned long get_irn_visited(const ir_node *node);
ir_visited_t get_irn_visited(const ir_node *node);
/** Sets the visited counter of a node. */
void set_irn_visited(ir_node *node, unsigned long visited);
void set_irn_visited(ir_node *node, ir_visited_t visited);
/** Sets visited to get_irg_visited(current_ir_graph). */
void mark_irn_visited(ir_node *node);
/** Returns 1 if visited < get_irg_visited(current_ir_graph). */
......@@ -363,8 +363,8 @@ 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()*/
unsigned long get_Block_block_visited(const ir_node *node);
void set_Block_block_visited(ir_node *node, unsigned long visit);
ir_visited_t get_Block_block_visited(const ir_node *node);
void set_Block_block_visited(ir_node *node, ir_visited_t visit);
/**
* Marks a block as dead but do not replace it with a Bad node.
......
......@@ -666,10 +666,10 @@ int equal_entity(ir_entity *ent1, ir_entity *ent2);
long get_entity_nr(const ir_entity *ent);
/** Returns the entities visited count. */
unsigned long get_entity_visited(ir_entity *ent);
ir_visited_t get_entity_visited(ir_entity *ent);
/** Sets the entities visited count. */
void set_entity_visited(ir_entity *ent, unsigned long num);
void set_entity_visited(ir_entity *ent, ir_visited_t num);
/** Sets visited field in entity to entity_visited. */
void mark_entity_visited(ir_entity *ent);
......@@ -1404,9 +1404,9 @@ unsigned get_type_alignment_bytes(ir_type *tp);
void set_type_alignment_bytes(ir_type *tp, unsigned align);
/** Returns the visited count of a type. */
unsigned long get_type_visited(const ir_type *tp);
ir_visited_t get_type_visited(const ir_type *tp);
/** Sets the visited count of a type to num. */
void set_type_visited(ir_type *tp, unsigned long num);
void set_type_visited(ir_type *tp, ir_visited_t num);
/** Sets visited field in type to type_visited. */
void mark_type_visited(ir_type *tp);
/** Returns non-zero if the type is already visited */
......@@ -1431,9 +1431,9 @@ void set_type_link(ir_type *tp, void *l);
*
* @see typewalk
*/
void set_master_type_visited(unsigned long val);
unsigned long get_master_type_visited(void);
void inc_master_type_visited(void);
void set_master_type_visited(ir_visited_t val);
ir_visited_t get_master_type_visited(void);
void inc_master_type_visited(void);
/**
* Sets the debug information of a type.
......
......@@ -52,10 +52,10 @@
#include "irgwalk.h"
static unsigned long master_cg_visited = 0;
static INLINE int cg_irg_visited (ir_graph *n);
static ir_visited_t master_cg_visited = 0;
static INLINE int cg_irg_visited (ir_graph *n);
static INLINE void mark_cg_irg_visited(ir_graph *n);
static INLINE void set_cg_irg_visited (ir_graph *n, unsigned long i);
static INLINE void set_cg_irg_visited (ir_graph *n, ir_visited_t i);
/** Returns the callgraph state of the program representation. */
irp_callgraph_state get_irp_callgraph_state(void) {
......@@ -465,14 +465,14 @@ static INLINE void mark_cg_irg_visited(ir_graph *irg) {
/**
* Set a graphs visited flag to i.
*/
static INLINE void set_cg_irg_visited(ir_graph *irg, unsigned long i) {
static INLINE void set_cg_irg_visited(ir_graph *irg, ir_visited_t i) {
irg->self_visited = i;
}
/**
* Returns the visited flag of a graph.
*/
static INLINE unsigned long get_cg_irg_visited(ir_graph *irg) {
static INLINE ir_visited_t get_cg_irg_visited(ir_graph *irg) {
return irg->self_visited;
}
......@@ -1018,7 +1018,7 @@ static void reset_isbe(void) {
static void compute_loop_depth(ir_graph *irg, void *env) {
int current_nesting = *(int *) env;
int old_nesting = irg->callgraph_loop_depth;
unsigned long old_visited = get_cg_irg_visited(irg);
ir_visited_t old_visited = get_cg_irg_visited(irg);
int i, n_callees;
//return ;
......
......@@ -284,12 +284,12 @@ ir_extblk *get_nodes_extbb(ir_node *node) {
}
/* Gets the visited counter of an extended block. */
unsigned long (get_extbb_visited)(const ir_extblk *blk) {
ir_visited_t (get_extbb_visited)(const ir_extblk *blk) {
return _get_extbb_visited(blk);
}
/* Sets the visited counter of an extended block. */
void (set_extbb_visited)(ir_extblk *blk, unsigned long visited) {
void (set_extbb_visited)(ir_extblk *blk, ir_visited_t visited) {
_set_extbb_visited(blk, visited);
}
......
......@@ -36,7 +36,7 @@
*/
struct _ir_extblk {
firm_kind kind; /**< k_ir_extblk */
unsigned long visited; /**< visited flag */
ir_visited_t visited; /**< visited flag */
ir_node **blks; /**< blocks belonging to this extended block */
void *link; /**< private link field */
};
......@@ -54,7 +54,7 @@ _is_ir_extbb (const void *thing) {
* Gets the visited counter of an extended block.
* Internal version for libFirm.
*/
static INLINE unsigned long
static INLINE ir_visited_t
_get_extbb_visited(const ir_extblk *blk) {
assert(blk);
return blk->visited;
......@@ -65,7 +65,7 @@ _get_extbb_visited(const ir_extblk *blk) {
* Internal version for libFirm.
*/
static INLINE void
_set_extbb_visited(ir_extblk *blk, unsigned long visited) {
_set_extbb_visited(ir_extblk *blk, ir_visited_t visited) {
assert(blk);
blk->visited = visited;
}
......
......@@ -89,7 +89,7 @@ static void *mris_irn_data_init(ir_phase *ph, const ir_node *irn, void *data)
}
#if 0
static int compute_height(mris_env_t *env, ir_node *irn, unsigned long visited)
static int compute_height(mris_env_t *env, ir_node *irn, ir_visited_t visited)
{
mris_irn_t *mi = get_mris_irn(env, irn);
......@@ -123,7 +123,7 @@ static int compute_height(mris_env_t *env, ir_node *irn, unsigned long visited)
static void compute_heights(mris_env_t *env)
{
const ir_edge_t *edge;
unsigned long visited;
ir_visited_t visited;
visited = get_irg_visited(env->irg) + 1;
set_irg_visited(env->irg, visited);
......@@ -209,7 +209,7 @@ static ir_node *put_lowest_in_front(mris_env_t *env, ir_node **in)
}
#if 0
static void reaches_walker(mris_env_t *env, ir_node *irn, ir_node *tgt, int *found, unsigned long visited)
static void reaches_walker(mris_env_t *env, ir_node *irn, ir_node *tgt, int *found, ir_visited_t visited)
{
if(get_irn_visited(irn) < visited && get_nodes_block(irn) == env->bl) {
......@@ -232,7 +232,7 @@ static void reaches_walker(mris_env_t *env, ir_node *irn, ir_node *tgt, int *fou
static int reaches(mris_env_t *env, ir_node *src, ir_node *tgt)
{
int found = 0;
unsigned long visited = get_irg_visited(env->irg) + 1;
ir_visited_t visited = get_irg_visited(env->irg) + 1;
set_irg_visited(env->irg, visited);
reaches_walker(env, src, tgt, &found, visited);
......
......@@ -84,7 +84,7 @@ typedef struct worklist_t worklist_t;
struct worklist_t {
struct list_head live_values;
size_t n_live_values;
unsigned long visited;
ir_visited_t visited;
};
typedef struct block_info_t block_info_t;
......@@ -103,7 +103,7 @@ static bool tentative_mode;
static bool should_have_reached_fixpoint;
static bool do_push_unused_livethroughs;
static ir_exec_freq *exec_freq;
static unsigned long worklist_visited;
static ir_visited_t worklist_visited;
static worklist_t *new_worklist(void)
{
......
......@@ -1573,7 +1573,7 @@ static void print_edge_vcgattr(FILE *F, ir_node *from, int to) {
/** dump edges to our inputs */
static void dump_ir_data_edges(FILE *F, ir_node *n) {
int i, num;
unsigned long visited = get_irn_visited(n);
ir_visited_t visited = get_irn_visited(n);
if (!dump_keepalive && is_End(n)) {
/* the End node has only keep-alive edges */
......
......@@ -925,18 +925,18 @@ void *
return _get_irg_link(irg);
}
unsigned long
ir_visited_t
(get_irg_visited)(const ir_graph *irg) {
return _get_irg_visited(irg);
}
#ifdef INTERPROCEDURAL_VIEW
/** maximum visited flag content of all ir_graph visited fields. */
static unsigned long max_irg_visited = 0;
static ir_visited_t max_irg_visited = 0;
#endif /* INTERPROCEDURAL_VIEW */
void
set_irg_visited(ir_graph *irg, unsigned long visited) {
set_irg_visited(ir_graph *irg, ir_visited_t visited) {
irg->visited = visited;
#ifdef INTERPROCEDURAL_VIEW
if (irg->visited > max_irg_visited) {
......@@ -957,13 +957,13 @@ inc_irg_visited(ir_graph *irg) {
}
#ifdef INTERPROCEDURAL_VIEW
unsigned long
ir_visited_t
get_max_irg_visited(void) {
/*
#ifndef NDEBUG
int i;
for(i = 0; i < get_irp_n_irgs(); i++)
assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
*/
assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
#endif
return max_irg_visited;
}
......@@ -971,24 +971,24 @@ void set_max_irg_visited(int val) {
max_irg_visited = val;
}
unsigned long
ir_visited_t
inc_max_irg_visited(void) {
/*
#ifndef NDEBUG
int i;
for(i = 0; i < get_irp_n_irgs(); i++)
assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
*/
assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
#endif
return ++max_irg_visited;
}
#endif /* INTERPROCEDURAL_VIEW */
unsigned long
ir_visited_t
(get_irg_block_visited)(const ir_graph *irg) {
return _get_irg_block_visited(irg);
}
void
(set_irg_block_visited)(ir_graph *irg, unsigned long visited) {
(set_irg_block_visited)(ir_graph *irg, ir_visited_t visited) {
_set_irg_block_visited(irg, visited);
}
......
......@@ -420,18 +420,18 @@ _get_irg_link(const ir_graph *irg) {
return irg->link;
}
static INLINE unsigned long
static INLINE ir_visited_t
_get_irg_visited(const ir_graph *irg) {
return irg->visited;
}
static INLINE unsigned long
static INLINE ir_visited_t
_get_irg_block_visited(const ir_graph *irg) {
return irg->block_visited;
}
static INLINE void
_set_irg_block_visited(ir_graph *irg, unsigned long visited) {
_set_irg_block_visited(ir_graph *irg, ir_visited_t visited) {
irg->block_visited = visited;
}
......
......@@ -51,7 +51,7 @@
* Walk over an interprocedural graph (callgraph).
* Visits only graphs in irg_set.
*/
static void irg_walk_cg(ir_node * node, unsigned long visited,
static void irg_walk_cg(ir_node * node, ir_visited_t visited,
pset_new_t *irg_set, irg_walk_func *pre,
irg_walk_func *post, void * env) {
int i;
......@@ -258,7 +258,7 @@ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
if (get_interprocedural_view()) {
pset_new_t irg_set;
pset_new_iterator_t iter;
unsigned long visited;
ir_visited_t visited;
ir_graph *irg;
assert(get_irp_ip_view_state() == ip_view_valid);
......
......@@ -445,11 +445,11 @@ ident *get_irn_opident(const ir_node *node) {
return node->op->name;
}
unsigned long (get_irn_visited)(const ir_node *node) {
ir_visited_t (get_irn_visited)(const ir_node *node) {
return _get_irn_visited(node);
}
void (set_irn_visited)(ir_node *node, unsigned long visited) {
void (set_irn_visited)(ir_node *node, ir_visited_t visited) {
_set_irn_visited(node, visited);
}
......@@ -719,11 +719,11 @@ void set_Block_matured(ir_node *node, int matured) {
node->attr.block.is_matured = matured;
}
unsigned long (get_Block_block_visited)(const ir_node *node) {
ir_visited_t (get_Block_block_visited)(const ir_node *node) {
return _get_Block_block_visited(node);
}
void (set_Block_block_visited)(ir_node *node, unsigned long visit) {
void (set_Block_block_visited)(ir_node *node, ir_visited_t visit) {
_set_Block_block_visited(node, visit);
}
......
......@@ -306,7 +306,7 @@ _set_irn_mode(ir_node *node, ir_mode *mode) {
* Gets the visited counter of a node.
* Intern version for libFirm.
*/
static INLINE unsigned long
static INLINE ir_visited_t
_get_irn_visited(const ir_node *node) {
assert(node);
return node->visited;
......@@ -317,7 +317,7 @@ _get_irn_visited(const ir_node *node) {
* Intern version for libFirm.
*/
static INLINE void
_set_irn_visited(ir_node *node, unsigned long visited) {
_set_irn_visited(ir_node *node, ir_visited_t visited) {
assert(node);
node->visited = visited;
}
......@@ -798,14 +798,14 @@ _get_Block_cfgpred_block(const ir_node *node, int pos) {
return res;
}
static INLINE unsigned long
static INLINE ir_visited_t
_get_Block_block_visited(const ir_node *node) {
assert(node->op == op_Block);
return node->attr.block.block_visited;
}
static INLINE void
_set_Block_block_visited(ir_node *node, unsigned long visit) {
_set_Block_block_visited(ir_node *node, ir_visited_t visit) {
assert(node->op == op_Block);
node->attr.block.block_visited = visit;
}
......
......@@ -122,7 +122,7 @@ struct ir_mode {
typedef struct {
/* General attributes */
ir_graph *irg; /**< The graph this block belongs to. */
unsigned long block_visited; /**< For the walker that walks over all blocks. */
ir_visited_t block_visited; /**< For the walker that walks over all blocks. */
/* Attributes private to construction: */
unsigned is_matured:1; /**< If set, all in-nodes of the block are fixed. */
unsigned is_dead:1; /**< If set, the block is dead (and could be replace by a Bad. */
......@@ -353,7 +353,7 @@ struct ir_node {
ir_op *op; /**< The Opcode of this node. */
ir_mode *mode; /**< The Mode of this node. */
struct ir_node **in; /**< The array of predecessors / operands. */
unsigned long visited; /**< The visited counter for walks of the graph. */
ir_visited_t visited; /**< The visited counter for walks of the graph. */
void *link; /**< To attach additional information to the node, e.g.
used while construction to link Phi0 nodes and
during optimization to link to nodes that
......@@ -490,13 +490,13 @@ struct ir_graph {
ir_loop *l; /**< For callgraph analysis. */
/* -- Fields for Walking the graph -- */
unsigned long visited; /**< this flag is an identifier for
ir_visited_t visited; /**< this flag is an identifier for
ir walk. it will be incremented
every time someone walks through
the graph */
unsigned long block_visited; /**< same as visited, for a complete block */
ir_visited_t block_visited; /**< same as visited, for a complete block */
unsigned long self_visited; /**< visited flag of the irg */
ir_visited_t self_visited; /**< visited flag of the irg */
unsigned estimated_node_count; /**< estimated number of nodes in this graph,
updated after every walk */
......
......@@ -202,7 +202,7 @@ typedef struct condeval_env_t {
pn_Cmp pnc; /**< The Compare mode of the Compare node. */
ir_node *cnst;
tarval *tv;
unsigned long visited_nr;
ir_visited_t visited_nr;
ir_node *cnst_pred; /**< the block before the constant */
int cnst_pos; /**< the pos to the constant block (needed to
......
......@@ -1333,11 +1333,11 @@ int equal_entity(ir_entity *ent1, ir_entity *ent2) {
} /* equal_entity */
unsigned long (get_entity_visited)(ir_entity *ent) {
ir_visited_t (get_entity_visited)(ir_entity *ent) {
return _get_entity_visited(ent);
} /* get_entity_visited */
void (set_entity_visited)(ir_entity *ent, unsigned long num) {
void (set_entity_visited)(ir_entity *ent, ir_visited_t num) {
_set_entity_visited(ent, num);
} /* set_entity_visited */
......
......@@ -155,7 +155,7 @@ struct ir_entity {
/**< If the entity is a bit field, this is the offset of
the start of the bit field within the byte specified
by offset. */
unsigned long visit; /**< visited counter for walks of the type information. */
ir_visited_t visit; /**< visited counter for walks of the type information. */
struct dbg_info *dbi; /**< A pointer to information for debug support. */
void *link; /**< To store some intermediate information. */
ir_type *repr_class; /**< If this entity represents a class info, the associated class. */
......@@ -428,14 +428,14 @@ _get_entity_irg(const ir_entity *ent) {
return irg;
}
static INLINE unsigned long
static INLINE ir_visited_t
_get_entity_visited(ir_entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->visit;
}
static INLINE void
_set_entity_visited(ir_entity *ent, unsigned long num) {
_set_entity_visited(ir_entity *ent, ir_visited_t num) {
assert(ent && ent->kind == k_entity);
ent->visit = num;
}
......
......@@ -224,7 +224,7 @@ static pset *get_type_map(const ir_type *tp, dir d) {
static void compute_down_closure(ir_type *tp) {
pset *myset, *subset;
int i, n_subtypes, n_members, n_supertypes;
unsigned long master_visited = get_master_type_visited();
ir_visited_t master_visited = get_master_type_visited();
assert(is_Class_type(tp));
......@@ -278,7 +278,7 @@ static void compute_down_closure(ir_type *tp) {
static void compute_up_closure(ir_type *tp) {
pset *myset, *subset;
int i, n_subtypes, n_members, n_supertypes;
unsigned long master_visited = get_master_type_visited();
ir_visited_t master_visited = get_master_type_visited();
assert(is_Class_type(tp));
......
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