Commit 997941bd authored by Michael Beck's avatar Michael Beck
Browse files

Partly undo r27277 and add a prototype for (formally undocumented)...

Partly undo r27277 and add a prototype for (formally undocumented) find_value(), needed by the edgjfe FE.

[r27363]
parent 89777009
......@@ -4456,6 +4456,16 @@ ir_node *get_value(int pos, ir_mode *mode);
*/
void set_value(int pos, ir_node *value);
/**
* Find the value number for a node in the current block.
*
* @param value the searched value
*
* @return the value number of the value or -1 if this value has
* no value number in the current block.
*/
int find_value(ir_node *value);
/** Get the current memory state.
*
* Use this function to obtain the last definition of the memory
......
......@@ -1390,6 +1390,18 @@ void set_value(int pos, ir_node *value)
irg->current_block->attr.block.graph_arr[pos + 1] = value;
} /* set_value */
/* Find the value number for a node in the current block.*/
int find_value(ir_node *value)
{
int i;
ir_node *bl = current_ir_graph->current_block;
for (i = ARR_LEN(bl->attr.block.graph_arr) - 1; i >= 1; --i)
if (bl->attr.block.graph_arr[i] == value)
return i - 1;
return -1;
} /* find_value */
/* get the current store */
ir_node *get_store(void)
{
......
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