summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beuses.c
diff options
context:
space:
mode:
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>2011-02-06 13:15:30 +0100
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>2011-02-06 13:15:30 +0100
commit08afd0c691c7f2c385a6ba0d3b3ce7c8891a0978 (patch)
tree9532c37e71a9ec0d8436b918881510565de08666 /ir/be/beuses.c
parent20f9f8abca7d902c432848500fd8a31822db0658 (diff)
Fixed size_t related warnings by isolating PTR_TO_INT macros.
Additionally: - rename some variables to reflect its content - add some doxygen comments [r28327]
Diffstat (limited to 'ir/be/beuses.c')
-rw-r--r--ir/be/beuses.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/ir/be/beuses.c b/ir/be/beuses.c
index 7baac59..57453e9 100644
--- a/ir/be/beuses.c
+++ b/ir/be/beuses.c
@@ -154,9 +154,27 @@ static int be_is_phi_argument(const ir_node *block, const ir_node *def)
return 0;
}
+/**
+ * Retrieve the scheduled index (the "step") of this node in its
+ * block.
+ *
+ * @param node the node
+ */
static inline unsigned get_step(const ir_node *node)
{
- return PTR_TO_INT(get_irn_link(node));
+ return (unsigned)PTR_TO_INT(get_irn_link(node));
+}
+
+/**
+ * Set the scheduled index (the "step") of this node in its
+ * block.
+ *
+ * @param node the node
+ * @param step the scheduled index of the node
+ */
+static inline void set_step(ir_node *node, unsigned step)
+{
+ set_irn_link(node, INT_TO_PTR(step));
}
static be_next_use_t get_next_use(be_uses_t *env, ir_node *from,
@@ -303,6 +321,13 @@ be_next_use_t be_get_next_use(be_uses_t *env, ir_node *from,
return get_next_use(env, from, from_step, def, skip_from_uses);
}
+/**
+ * Pre-block walker, set the step number for every scheduled node
+ * in increasing order.
+ *
+ * After this, two scheduled nodes can be easily compared for the
+ * "scheduled earlier in block" property.
+ */
static void set_sched_step_walker(ir_node *block, void *data)
{
ir_node *node;
@@ -310,7 +335,7 @@ static void set_sched_step_walker(ir_node *block, void *data)
(void) data;
sched_foreach(block, node) {
- set_irn_link(node, INT_TO_PTR(step));
+ set_step(node, step);
if (is_Phi(node))
continue;
++step;