Commit 6c50ffd5 authored by Michael Beck's avatar Michael Beck
Browse files

dump_node operatiomn added

get_op_ops() added

[r6817]
parent eb2bcd44
......@@ -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);
}
......@@ -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_ */
......@@ -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_ */
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