Commit b297748d authored by Michael Beck's avatar Michael Beck
Browse files

add_Sync_pred() implemented

some is_*() functions added

[r7802]
parent d5047f0e
......@@ -783,8 +783,13 @@ get_End_keepalive(ir_node *end, int pos) {
void
add_End_keepalive (ir_node *end, ir_node *ka) {
assert (end->op == op_End);
ARR_APP1 (ir_node *, end->in, ka);
int l;
ir_graph *irg = get_irn_irg(end);
assert(end->op == op_End);
l = ARR_LEN(end->in);
ARR_APP1(ir_node *, end->in, ka);
edges_notify_edge(end, l, end->in[l], NULL, irg);
}
void
......@@ -1756,37 +1761,43 @@ set_Free_where (ir_node *node, where_alloc where) {
node->attr.f.where = where;
}
ir_node **
get_Sync_preds_arr (ir_node *node) {
ir_node **get_Sync_preds_arr (ir_node *node) {
assert (node->op == op_Sync);
return (ir_node **)&(get_irn_in(node)[1]);
}
int
get_Sync_n_preds (ir_node *node) {
assert (node->op == op_Sync);
int get_Sync_n_preds (ir_node *node) {
assert(node->op == op_Sync);
return (get_irn_arity(node));
}
/*
void
set_Sync_n_preds (ir_node *node, int n_preds) {
void set_Sync_n_preds (ir_node *node, int n_preds) {
assert (node->op == op_Sync);
}
*/
ir_node *
get_Sync_pred (ir_node *node, int pos) {
assert (node->op == op_Sync);
ir_node *get_Sync_pred (ir_node *node, int pos) {
assert(node->op == op_Sync);
return get_irn_n(node, pos);
}
void
set_Sync_pred (ir_node *node, int pos, ir_node *pred) {
assert (node->op == op_Sync);
void set_Sync_pred (ir_node *node, int pos, ir_node *pred) {
assert(node->op == op_Sync);
set_irn_n(node, pos, pred);
}
/* Add a new Sync predecessor */
void add_Sync_pred (ir_node *node, ir_node *pred) {
int l;
ir_graph *irg = get_irn_irg(node);
assert(node->op == op_Sync);
l = ARR_LEN(node->in);
ARR_APP1(ir_node *, node->in, pred);
edges_notify_edge(node, l, node->in[l], NULL, irg);
}
ir_type *get_Proj_type(ir_node *n)
{
ir_type *tp = NULL;
......@@ -2440,6 +2451,24 @@ int
return _is_Mux(node);
}
/* returns true if node is a Load node. */
int
(is_Load)(const ir_node *node) {
return _is_Load(node);
}
/* returns true if node is a Sync node. */
int
(is_Sync)(const ir_node *node) {
return _is_Sync(node);
}
/* returns true if node is a Confirm node. */
int
(is_Confirm)(const ir_node *node) {
return _is_Confirm(node);
}
int
is_Proj (const ir_node *node) {
assert(node);
......
......@@ -892,6 +892,7 @@ ir_node **get_Sync_preds_arr (ir_node *node);
int get_Sync_n_preds (ir_node *node);
ir_node *get_Sync_pred (ir_node *node, int pos);
void set_Sync_pred (ir_node *node, int pos, ir_node *pred);
void add_Sync_pred (ir_node *node, ir_node *pred);
/** Returns the source language type of a Proj node.
* Must be an atomic type. Mode of type must be mode of node.
......@@ -1066,6 +1067,12 @@ int is_Call (const ir_node *node);
int is_Sel (const ir_node *node);
/** returns true if node is a Mux node or a Psi with only one condition. */
int is_Mux (const ir_node *node);
/** returns true if node is a Load node. */
int is_Load (const ir_node *node);
/** returns true if node is a Sync node. */
int is_Sync (const ir_node *node);
/** returns true if node is a Confirm node. */
int is_Confirm (const ir_node *node);
/** returns true if node is a Proj node or a Filter node in
* intraprocedural view */
int is_Proj (const ir_node *node);
......
......@@ -637,6 +637,24 @@ _is_Mux (const ir_node *node) {
return 0;
}
static INLINE int
_is_Load (const ir_node *node) {
assert(node);
return (node && _get_irn_op(node) == op_Load);
}
static INLINE int
_is_Sync (const ir_node *node) {
assert(node);
return (node && _get_irn_op(node) == op_Sync);
}
static INLINE int
_is_Confirm (const ir_node *node) {
assert(node);
return (node && _get_irn_op(node) == op_Confirm);
}
static INLINE int
_is_no_Block(const ir_node *node) {
assert(node && _is_ir_node(node));
......@@ -829,6 +847,9 @@ static INLINE unsigned _get_irn_idx(const ir_node *node) {
#define is_Call(node) _is_Call(node)
#define is_Sel(node) _is_Sel(node)
#define is_Mux(node) _is_Mux(node)
#define is_Load(node) _is_Load(node)
#define is_Sync(node) _is_Sync(node)
#define is_Confirm(node) _is_Confirm(node)
#define is_Bad(node) _is_Bad(node)
#define is_no_Block(node) _is_no_Block(node)
#define is_Block(node) _is_Block(node)
......
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