From: Michael Beck Date: Wed, 6 Apr 2005 09:07:42 +0000 (+0000) Subject: Added verify_node() operation X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=381b12255e4d00eef026acff738f24ebe8ea989b;p=libfirm Added verify_node() operation [r5585] --- diff --git a/ir/ir/irop.c b/ir/ir/irop.c index fce150ab1..3d1efc3ea 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -23,6 +23,7 @@ # include "irhooks.h" # include "iropt_t.h" /* for firm_set_default_operations */ +# include "irvrfy_t.h" # include "xmalloc.h" @@ -148,6 +149,7 @@ new_ir_op(opcode code, const char *name, op_pin_state p, unsigned flags, op_arit firm_set_default_operations(res); firm_set_default_copy_attr(res); + firm_set_default_verifyer(res); hook_new_ir_op(res); return res; diff --git a/ir/ir/irop_t.h b/ir/ir/irop_t.h index 5cc368631..62bbf6cbc 100644 --- a/ir/ir/irop_t.h +++ b/ir/ir/irop_t.h @@ -102,6 +102,24 @@ typedef void (*copy_attr_func)(const ir_node *old_node, ir_node *new_node); */ typedef type *(*get_type_func)(ir_node *self); +/** + * The verify_node operation. + * Return non-zero if the node verification is ok, else 0. + * Depending on the node verification settings, may even assert. + * + * @see do_node_verification() + */ +typedef int (*verify_node_func)(ir_node *self, ir_graph *irg); + +/** + * The verify_node operation for Proj(X). + * Return non-zero if the node verification is ok, else 0. + * Depending on the node verification settings, may even assert. + * + * @see do_node_verification() + */ +typedef int (*verify_proj_node_func)(ir_node *self, ir_node *proj); + /** The type of an ir_op. */ struct ir_op { opcode code; /**< the unique opcode of the op */ @@ -120,6 +138,8 @@ struct ir_op { reassociate_func reassociate; /**< reassociate a tree */ copy_attr_func copy_attr; /**< copy node attributes */ 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 */ }; /**