Commit 7b113152 authored by Sebastian Felis's avatar Sebastian Felis
Browse files

add is_ir_node() function.

[r1479]
parent c937e07b
...@@ -137,6 +137,15 @@ copy_attrs (ir_node *old, ir_node *new) { ...@@ -137,6 +137,15 @@ copy_attrs (ir_node *old, ir_node *new) {
/** getting some parameters from ir_nodes **/ /** getting some parameters from ir_nodes **/
int
is_ir_node (void *thing) {
assert(thing);
if (get_kind(thing) == k_ir_node)
return 1;
else
return 0;
}
/* returns the number of predecessors without the block predecessor. */ /* returns the number of predecessors without the block predecessor. */
INLINE int INLINE int
get_irn_arity (const ir_node *node) { get_irn_arity (const ir_node *node) {
......
...@@ -82,6 +82,17 @@ typedef struct ir_node ir_node; ...@@ -82,6 +82,17 @@ typedef struct ir_node ir_node;
* of nodes, it's just a big graph. * of nodes, it's just a big graph.
*/ */
/**
* Checks whether a pointer points to a ir node.
*
* @param thing an arbitrary pointer
*
* @return
* true if the thing is a ir mode, else false
*/
int
is_ir_node (void *thing);
/** returns the number of predecessors without the block predecessor: */ /** returns the number of predecessors without the block predecessor: */
int get_irn_arity (const ir_node *node); int get_irn_arity (const ir_node *node);
......
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