dump_node operatiomn added
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 27 Oct 2005 13:49:56 +0000 (13:49 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 27 Oct 2005 13:49:56 +0000 (13:49 +0000)
get_op_ops() added

[r6817]

ir/ir/irop.c
ir/ir/irop.h
ir/ir/irop_t.h

index 6f4832e..23e9d89 100644 (file)
@@ -391,3 +391,8 @@ op_func (get_generic_function_ptr)(const ir_op *op) {
 void (set_generic_function_ptr)(ir_op *op, op_func func) {
   _set_generic_function_ptr(op, func);
 }
+
+/* Returns the ir_op_ops of an ir_op. */
+const ir_op_ops *(get_op_ops)(const ir_op *op) {
+  return _get_op_ops(op);
+}
index b3a0de1..1c3d565 100644 (file)
@@ -263,6 +263,22 @@ typedef int (*verify_node_func)(ir_node *self, ir_graph *irg);
  */
 typedef int (*verify_proj_node_func)(ir_node *self, ir_node *proj);
 
+/**
+ * Reasons to call the dump_node operation:
+ */
+typedef enum {
+  dump_node_opcode_txt,   /**< dump the opcode */
+  dump_node_mode_txt,     /**< dump the mode */
+  dump_node_nodeattr_txt, /**< dump the node attributes */
+} dump_reason_t;
+
+/**
+ * The dump_node operation.
+ * Writes several informations requested by reason to
+ * an output file
+ */
+typedef int (*dump_node_func)(ir_node *self, FILE *F, dump_reason_t reason);
+
 /**
  * io_op Operations.
  */
@@ -276,6 +292,7 @@ typedef struct {
   get_type_func         get_type;         /**< return the type of a node */
   verify_node_func      verify_node;      /**< verify the node */
   verify_proj_node_func verify_proj_node; /**< verify the Proj node */
+  dump_node_func        dump_node;        /**< dump a node */
   op_func               generic;          /**< a generic function */
 } ir_op_ops;
 
@@ -301,4 +318,7 @@ ir_op * new_ir_op(opcode code, const char *name, op_pin_state p,
                   unsigned flags, op_arity opar, int op_index, size_t attr_size,
        const ir_op_ops *ops);
 
+/** Returns the ir_op_ops of an ir_op. */
+const ir_op_ops *get_op_ops(const ir_op *op);
+
 #endif /* _IROP_H_ */
index 1b4b040..29f473e 100644 (file)
@@ -120,9 +120,14 @@ static INLINE op_func _get_generic_function_ptr(const ir_op *op) {
   return op->ops.generic;
 }
 
+static INLINE const ir_op_ops *_get_op_ops(const ir_op *op) {
+  return &op->ops;
+}
+
 #define get_op_code(op)         _get_op_code(op)
 #define get_op_ident(op)        _get_op_ident(op)
 #define get_op_pinned(op)       _get_op_pinned(op)
+#define get_op_ops(op)          _get_op_ops(op)
 
 
 #endif /* _IROP_T_H_ */