Commit 7c642309 authored by Matthias Braun's avatar Matthias Braun
Browse files

rename get_irn_deps to get_irn_n_deps

parent a658875d
......@@ -91,11 +91,12 @@ FIRM_API void add_irn_dep(ir_node *node, ir_node *dep);
FIRM_API void add_irn_deps(ir_node *tgt, ir_node *src);
/**
* Returns the length of the dependency array.
* Returns the number of dependency predecessors/edges of node @p node.
* @param node The node.
* @return The length of the dependency array or 0 if it has not yet been allocated.
* @return The length of the dependency array or 0 if it has not yet been
* allocated.
*/
FIRM_API int get_irn_deps(const ir_node *node);
FIRM_API int get_irn_n_deps(const ir_node *node);
/**
* Returns an entry of the dependency array.
......
......@@ -63,7 +63,7 @@ static inline ir_node *be_get_transformed_node(ir_node *old_node)
void be_duplicate_deps(ir_node *old_node, ir_node *new_node)
{
int deps = get_irn_deps(old_node);
int deps = get_irn_n_deps(old_node);
for (int i = 0; i < deps; ++i) {
ir_node *dep = get_irn_dep(old_node, i);
ir_node *new_dep = be_transform_node(dep);
......@@ -277,7 +277,7 @@ static void fix_loops(ir_node *node)
changed = true;
}
arity = get_irn_deps(node);
arity = get_irn_n_deps(node);
for (int i = 0; i < arity; ++i) {
ir_node *in = get_irn_dep(node, i);
ir_node *nw = (ir_node*)get_irn_link(in);
......
......@@ -137,7 +137,7 @@ ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
copy_node_attr(irg, node, res);
/* duplicate dependency edges */
for (int i = 0, n_deps = get_irn_deps(node); i < n_deps; ++i) {
for (int i = 0, n_deps = get_irn_n_deps(node); i < n_deps; ++i) {
ir_node *dep = get_irn_dep(node, i);
add_irn_dep(res, dep);
}
......@@ -170,7 +170,7 @@ void irn_rewire_inputs(ir_node *node)
set_irn_n(new_node, i, new_in);
}
for (int i = 0, n_deps = get_irn_deps(new_node); i < n_deps; ++i) {
for (int i = 0, n_deps = get_irn_n_deps(new_node); i < n_deps; ++i) {
ir_node *dep = get_irn_dep(node, i);
ir_node *new_dep = get_new_node(dep);
set_irn_dep(new_node, i, new_dep);
......
......@@ -1236,7 +1236,7 @@ static void dump_ir_data_edges(FILE *F, const ir_node *n)
}
/* dump the dependency edges. */
num = get_irn_deps(n);
num = get_irn_n_deps(n);
for (i = 0; i < num; ++i) {
ir_node *dep = get_irn_dep(n, i);
......
......@@ -104,7 +104,7 @@ static ir_node *get_irn_safe_n(const ir_node *node, int n)
static const ir_edge_kind_info_t edge_kind_info[EDGE_KIND_LAST+1] = {
{ "normal" , set_irn_n, -1, get_irn_arity, get_irn_safe_n },
{ "block succs", NULL, 0, get_irn_arity, get_block_n },
{ "dependency", set_irn_dep, 0, get_irn_deps, get_irn_dep }
{ "dependency", set_irn_dep, 0, get_irn_n_deps, get_irn_dep }
};
#define foreach_tgt(irn, i, n, kind) for (i = edge_kind_info[kind].first_idx, n = edge_kind_info[kind].get_arity(irn); i < n; ++i)
......@@ -479,7 +479,7 @@ static void init_lh_walker_dep(ir_node *irn, void *data)
get_irn_edge_info(irn, kind)->edges_built = 0;
get_irn_edge_info(irn, kind)->out_count = 0;
for (i = get_irn_deps(irn) - 1; i >= 0; --i) {
for (i = get_irn_n_deps(irn) - 1; i >= 0; --i) {
ir_node *dep = get_irn_dep(irn, i);
head = &get_irn_edge_info(dep, kind)->outs_head;
......
......@@ -254,9 +254,9 @@ void remove_Sync_n(ir_node *n, int i)
remove_irn_n(n, i);
}
int (get_irn_deps)(const ir_node *node)
int (get_irn_n_deps)(const ir_node *node)
{
return get_irn_deps_(node);
return get_irn_n_deps_(node);
}
ir_node *(get_irn_dep)(const ir_node *node, int pos)
......@@ -314,7 +314,7 @@ void add_irn_deps(ir_node *tgt, ir_node *src)
{
int i, n;
for (i = 0, n = get_irn_deps(src); i < n; ++i)
for (i = 0, n = get_irn_n_deps(src); i < n; ++i)
add_irn_dep(tgt, get_irn_dep(src, i));
}
......
......@@ -63,7 +63,7 @@
#define get_irn_generic_attr_const(node) get_irn_generic_attr_const_(node)
#define get_irn_idx(node) get_irn_idx_(node)
#define get_irn_deps(node) get_irn_deps_(node)
#define get_irn_n_deps(node) get_irn_n_deps_(node)
#define get_irn_dep(node, pos) get_irn_dep_(node, pos)
#define get_irn_ins_or_deps(node) get_irn_ins_or_deps_(node)
......@@ -185,7 +185,7 @@ static inline unsigned hash_irn(const ir_node *node)
return (unsigned) get_irn_idx(node);
}
static inline int get_irn_deps_(const ir_node *node)
static inline int get_irn_n_deps_(const ir_node *node)
{
return node->deps ? (int)ARR_LEN(node->deps) : 0;
}
......@@ -201,7 +201,7 @@ void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt, ir_node *old_tg
static inline int get_irn_ins_or_deps_(const ir_node *irn)
{
return get_irn_deps_(irn) + get_irn_arity_(irn);
return get_irn_n_deps_(irn) + get_irn_arity_(irn);
}
static inline ir_node *get_irn_in_or_dep_(const ir_node *irn, int pos)
......
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