add is_ir_node() function.
authorSebastian Felis <felis@ipd.info.uni-karlsruhe.de>
Mon, 14 Jul 2003 10:04:42 +0000 (10:04 +0000)
committerSebastian Felis <felis@ipd.info.uni-karlsruhe.de>
Mon, 14 Jul 2003 10:04:42 +0000 (10:04 +0000)
[r1479]

ir/ir/irnode.c
ir/ir/irnode.h

index c3d95dc..9baf74e 100644 (file)
@@ -137,6 +137,15 @@ copy_attrs (ir_node *old, ir_node *new) {
 
 /** 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. */
 INLINE int
 get_irn_arity (const ir_node *node) {
index 79a5ea0..37a99a6 100644 (file)
@@ -82,6 +82,17 @@ typedef struct ir_node ir_node;
  *   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: */
 int                  get_irn_arity         (const ir_node *node);