X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftrvrfy.h;h=bca59bd49843eab610d96160b169824af18e0ee8;hb=3dcd2e4abeb4c078c04e9c1853ba5755ce6f021e;hp=c52e0079d5db7b67529a8d789c96702a7759b00c;hpb=06eb898c34d0ae7125d1bf02afdf949ba496c47c;p=libfirm diff --git a/ir/tr/trvrfy.h b/ir/tr/trvrfy.h index c52e0079d..bca59bd49 100644 --- a/ir/tr/trvrfy.h +++ b/ir/tr/trvrfy.h @@ -1,3 +1,14 @@ +/* + * Project: libFIRM + * File name: ir/tr/trvrfy.h + * Purpose: Check types and entities for correctness. + * Author: Michael Beck, Goetz Lindenmaier + * Modified by: + * Created: 29.1.2003 + * CVS-ID: $Id$ + * Copyright: (c) 2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ #ifndef TRVRFY_H @@ -8,34 +19,49 @@ * * Methods to verify the type representations. * - * @author Goetz Lindenmaier + * @author Michael Beck, Goetz Lindenmaier * * Methods to verify the type representations. * Copyright 2003 University of Karlsruhe. * Created 29.1.2003. * - * $Id$ */ #include "firm.h" /** - * possible error codes + * possible trvrfy() error codes */ enum trvrfy_error_codes { - no_error = 0, - error_ent_not_cont = 1, - error_null_mem, + 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 */ }; /** * Walks the type information and performs a set of sanity checks. * + * 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 + * * @return * 0 if graph is correct * else error code. */ -int tr_vrfy(); +int tr_vrfy(void); + +/** + * If NDEBUG is defined performs nothing, else calles the tr_vrfy() function. + */ +#ifdef NDEBUG +#define TR_VRFY() 0 +#else +#define TR_VRFY() tr_vrfy() +#endif #endif /* TRVRFY_H */