Commit 7bf9fdac authored by Michael Beck's avatar Michael Beck
Browse files

restored old behavior of dump_ir_*_sched() functions: Can be called without schedule info available

[r16981]
parent 8593cd34
......@@ -47,6 +47,7 @@
#include "beutil.h"
#include "belistsched.h"
FIRM_IMPL1(have_sched_info, int, const ir_graph *)
FIRM_IMPL1(sched_get_time_step, int, const ir_node *)
FIRM_IMPL1(sched_has_next, int, const ir_node *)
FIRM_IMPL1(sched_has_prev, int, const ir_node *)
......
......@@ -39,6 +39,7 @@ void be_sched_dump(FILE *f, ir_graph *irg);
* unique to that block. a node schedule before another node has a lower
* timestep than this node.
*/
int have_sched_info(const ir_graph *irg);
int sched_get_time_step(const ir_node *irn);
int sched_has_next(const ir_node *irn);
int sched_has_prev(const ir_node *irn);
......
......@@ -58,6 +58,16 @@ typedef struct _sched_info_t {
#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.
......@@ -65,7 +75,7 @@ typedef struct _sched_info_t {
*/
static INLINE int _sched_is_scheduled(const ir_node *irn)
{
return get_irn_sched_info(irn)->scheduled;
return get_irn_sched_info(irn)->scheduled;
}
/**
......@@ -338,6 +348,7 @@ int sched_skip_phi_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)
......
......@@ -145,7 +145,8 @@ void dump_ir_block_graph_sched(ir_graph *irg, const char *suffix) {
DUMP_NODE_EDGE_FUNC old = get_dump_node_edge_hook();
dump_consts_local(0);
set_dump_node_edge_hook(sched_edge_hook);
if (have_sched_info(irg))
set_dump_node_edge_hook(sched_edge_hook);
dump_ir_block_graph(irg, suffix);
set_dump_node_edge_hook(old);
}
......@@ -154,7 +155,8 @@ void dump_ir_extblock_graph_sched(ir_graph *irg, const char *suffix) {
DUMP_NODE_EDGE_FUNC old = get_dump_node_edge_hook();
dump_consts_local(0);
set_dump_node_edge_hook(sched_edge_hook);
if (have_sched_info(irg))
set_dump_node_edge_hook(sched_edge_hook);
dump_ir_extblock_graph(irg, suffix);
set_dump_node_edge_hook(old);
}
......
Supports Markdown
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