Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
75da6f9f
Commit
75da6f9f
authored
May 10, 2006
by
Christian Würdig
Browse files
added new function to determine the predecessor position of node for a given predecessor
[r7715]
parent
07a53d99
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/irnode.c
View file @
75da6f9f
...
...
@@ -564,6 +564,15 @@ unsigned (get_irn_idx)(const ir_node *node) {
return
_get_irn_idx
(
node
);
}
int
get_irn_pred_pos
(
ir_node
*
node
,
ir_node
*
arg
)
{
int
i
;
for
(
i
=
get_irn_arity
(
node
)
-
1
;
i
>=
0
;
i
--
)
{
if
(
get_irn_n
(
node
,
i
)
==
arg
)
return
i
;
}
return
-
1
;
}
/** manipulate fields of individual nodes **/
/* this works for all except Block */
...
...
ir/ir/irnode.h
View file @
75da6f9f
...
...
@@ -132,6 +132,8 @@ opcode get_irn_opcode (const ir_node *node);
const
char
*
get_irn_opname
(
const
ir_node
*
node
);
/** Get the ident for a string representation of the opcode. */
ident
*
get_irn_opident
(
const
ir_node
*
node
);
/** If arg is an argument of the node, returns it's position, -1 otherwise */
int
get_irn_pred_pos
(
ir_node
*
node
,
ir_node
*
arg
);
/** Gets the visited counter of a node. */
unsigned
long
get_irn_visited
(
const
ir_node
*
node
);
/** Sets the visited counter of a node. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment