Commit bf048572 authored by Matthias Braun's avatar Matthias Braun
Browse files

make get_Block_matured get_Block_cfgpred_block accept const ir_nodes, add a hash_irn function

[r16418]
parent 294764ce
......@@ -347,7 +347,7 @@ int is_value_arg_pointer(ir_node *n);
/* @@@ no more supported */
ir_node **get_Block_cfgpred_arr(ir_node *node);
int get_Block_n_cfgpreds(const ir_node *node);
ir_node *get_Block_cfgpred(ir_node *node, int pos);
ir_node *get_Block_cfgpred(const ir_node *node, int pos);
void set_Block_cfgpred(ir_node *node, int pos, ir_node *pred);
/** Get the predecessor block.
*
......@@ -360,8 +360,8 @@ void set_Block_cfgpred(ir_node *node, int pos, ir_node *pred);
* - If we encounter the Bad node, this function does not return
* Start, but the Bad node.
*/
ir_node *get_Block_cfgpred_block(ir_node *node, int pos);
int get_Block_matured(ir_node *node);
ir_node *get_Block_cfgpred_block(const ir_node *node, int pos);
int get_Block_matured(const ir_node *node);
void set_Block_matured(ir_node *node, int matured);
/** A visited flag only for block nodes.
......
......@@ -733,7 +733,7 @@ int
}
ir_node *
(get_Block_cfgpred)(ir_node *node, int pos) {
(get_Block_cfgpred)(const ir_node *node, int pos) {
return _get_Block_cfgpred(node, pos);
}
......@@ -744,12 +744,12 @@ set_Block_cfgpred(ir_node *node, int pos, ir_node *pred) {
}
ir_node *
(get_Block_cfgpred_block)(ir_node *node, int pos) {
(get_Block_cfgpred_block)(const ir_node *node, int pos) {
return _get_Block_cfgpred_block(node, pos);
}
int
get_Block_matured(ir_node *node) {
get_Block_matured(const ir_node *node) {
assert(node->op == op_Block);
return (int)node->attr.block.is_matured;
}
......
......@@ -226,6 +226,14 @@ _get_irn_inter_n(const ir_node *node, int n) {
return _get_irn_intra_n(node, n);
}
/**
* returns a hash value for a node
*/
static INLINE unsigned hash_irn(const ir_node *node)
{
return (unsigned) get_irn_idx(node);
}
/**
* Access to the predecessors of a node.
* To iterate over the operands iterate from 0 to i < get_irn_arity(),
......@@ -714,7 +722,7 @@ _get_Block_n_cfgpreds(const ir_node *node) {
}
static INLINE ir_node *
_get_Block_cfgpred(ir_node *node, int pos) {
_get_Block_cfgpred(const ir_node *node, int pos) {
assert(0 <= pos && pos < get_irn_arity(node));
assert(_is_Block(node));
return _get_irn_n(node, pos);
......@@ -732,7 +740,7 @@ _get_Block_cfgpred(ir_node *node, int pos) {
* Start, but the Bad node.
*/
static INLINE ir_node *
_get_Block_cfgpred_block(ir_node *node, int pos) {
_get_Block_cfgpred_block(const ir_node *node, int pos) {
ir_node *res = skip_Proj(get_Block_cfgpred(node, pos));
if (!is_Bad(res))
res = get_nodes_block(res);
......
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