X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftrvrfy.h;h=2e3e15666e92197dfebf62da7a671050147dcc93;hb=d0d85962ef52c14950db90e5981a7bea36023ab3;hp=bca59bd49843eab610d96160b169824af18e0ee8;hpb=20ef55b33512a82b99615afa325d0b80805192ee;p=libfirm diff --git a/ir/tr/trvrfy.h b/ir/tr/trvrfy.h index bca59bd49..2e3e15666 100644 --- a/ir/tr/trvrfy.h +++ b/ir/tr/trvrfy.h @@ -9,11 +9,11 @@ * Copyright: (c) 2003 Universität Karlsruhe * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ - - #ifndef TRVRFY_H #define TRVRFY_H +#include "firm_types.h" + /** * @file trvrfy.h * @@ -27,19 +27,39 @@ * */ -#include "firm.h" - /** * possible trvrfy() error codes */ -enum trvrfy_error_codes { - no_error = 0, /**< no error */ - error_ent_not_cont = 1, /**< overwritten entity not in superclass */ - error_null_mem = 2, /**< compound contains NULL member */ - error_const_on_wrong_irg = 3, /**< constant placed on wrong IRG */ - error_existent_entity_without_irg = 4 /**< Method ents with pec_exist must have an irg */ +enum trvrfy_error_codes { + no_error = 0, /**< no error */ + error_ent_not_cont, /**< overwritten entity not in superclass */ + error_null_mem, /**< compound contains NULL member */ + error_const_on_wrong_irg, /**< constant placed on wrong IRG */ + error_existent_entity_without_irg, /**< Method entities with pecularity_exist must have an irg */ + error_wrong_ent_overwrites, /**< number of entity overwrites exceeds number of class overwrites */ + error_inherited_ent_without_const, /**< inherited method entity not pointing to existent entity */ + error_glob_ent_allocation, /**< wrong allocation of a global entity */ + error_ent_const_mode, /**< Mode of constant in entity did not match entities type. */ + error_ent_wrong_owner /**< Mode of constant in entity did not match entities type. */ }; +/** + * Checks a type. + * + * @return + * 0 if no error encountered + */ +int check_type(ir_type *tp); + +/** + * Check an entity. Currently, we check only if initialized constants + * are build on the const irg graph. + * + * @return + * 0 if no error encountered + * != 0 a trvrfy_error_codes code + */ +int check_entity(entity *ent); /** * Walks the type information and performs a set of sanity checks. @@ -47,7 +67,7 @@ enum trvrfy_error_codes { * Currently, the following checks are executed: * - values of initialized entities must be allocated on the constant IRG * - class types: doesn't have NULL members - * - class types: all overwrites are existant in the super type + * - class types: all overwrites are existent in the super type * * @return * 0 if graph is correct @@ -56,7 +76,7 @@ enum trvrfy_error_codes { int tr_vrfy(void); /** - * If NDEBUG is defined performs nothing, else calles the tr_vrfy() function. + * If NDEBUG is defined performs nothing, else calls the tr_vrfy() function. */ #ifdef NDEBUG #define TR_VRFY() 0