/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
#define get_irn_sched_info(irn) ((sched_info_t *) get_or_set_irn_phase_info(skip_Proj_const(irn), PHASE_BE_SCHED))
#define get_sched_info_irn(irg, sched_info) get_idx_irn((irg), (sched_info)->idx)
+/**
+ * Returns non-zero if schedule information is available
+ * for a given graph.
+ * @param irg The graph.
+ */
+static INLINE int _have_sched_info(const ir_graph *irg)
+{
+ return get_irg_phase(irg, PHASE_BE_SCHED) != NULL;
+}
+
/**
* Check, if the node is scheduled.
* @param irn The node.
*/
static INLINE int _sched_is_scheduled(const ir_node *irn)
{
- return get_irn_sched_info(irn)->scheduled;
+ return get_irn_sched_info(irn)->scheduled;
}
/**
*/
static INLINE void _sched_remove(const ir_node *irn)
{
- sched_info_t *info;
-#ifndef SCHEDULE_PROJ
- assert(!is_Proj(irn));
-#endif
- info = get_irn_sched_info(irn);
+ sched_info_t *info = get_irn_sched_info(irn);
list_del(&info->list);
INIT_LIST_HEAD(&info->list);
info->scheduled = 0;
{
assert(_sched_is_scheduled(n1));
assert(_sched_is_scheduled(n2));
- assert(get_nodes_block(n1) == get_nodes_block(n2));
+ assert((is_Block(n1) ? n1 : get_nodes_block(n1)) == (is_Block(n2) ? n2 : get_nodes_block(n2)));
return _sched_get_time_step(n1) < _sched_get_time_step(n2);
}
* Predicate for sched_skip(), returns non-zero if irn is a control flow changing node.
*
* @param irn the node to evaluate
- * @param data an arch_env_t * used to determine if irn is a cf
- * node for the given architecture
+ * @param data unused
*/
int sched_skip_cf_predicator(const ir_node *irn, void *data);
*/
ir_node *sched_skip(ir_node *from, int forward, sched_predicator_t *predicator, void *data);
+#define have_sched_info(irg) _have_sched_info(irg)
#define sched_get_time_step(irn) _sched_get_time_step(irn)
#define sched_has_next(irn) _sched_has_next(irn)
#define sched_has_prev(irn) _sched_has_prev(irn)