added copyright information
[libfirm] / ir / tr / trvrfy.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/tr/trvrfy.h
4  * Purpose:     Check types and entities for correctness.
5  * Author:      Michael Beck, Goetz Lindenmaier
6  * Modified by:
7  * Created:     29.1.2003
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13
14 #ifndef TRVRFY_H
15 #define TRVRFY_H
16
17 /**
18  * @file trvrfy.h
19  *
20  * Methods to verify the type representations.
21  *
22  * @author Michael Beck, Goetz Lindenmaier
23  *
24  * Methods to verify the type representations.
25  * Copyright 2003 University of Karlsruhe.
26  * Created 29.1.2003.
27  *
28  */
29
30 #include "firm.h"
31
32 /**
33  * possible trvrfy() error codes
34  */
35 enum  trvrfy_error_codes {
36   no_error                 = 0,         /**< no error */
37   error_ent_not_cont       = 1,         /**< overwritten entity not in superclass */
38   error_null_mem           = 2,         /**< compound contains NULL member */
39   error_const_on_wrong_irg = 3          /**< constant placed on wrong IRG */
40 };
41
42
43 /**
44  * Walks the type information and performs a set of sanity checks.
45  *
46  * Currently, the following checks are executed:
47  * - values of initialized entities must be allocated on the constant IRG
48  * - class types: doesn't have NULL members
49  * - class types: all overwrites are existant in the super type
50  *
51  * @return
52  *    0 if graph is correct
53  *    else error code.
54  */
55 int tr_vrfy(void);
56
57 /**
58  * If NDEBUG is defined performs nothing, else calles the tr_vrfy() function.
59  */
60 #ifdef NDEBUG
61 #define TR_VRFY()       0
62 #else
63 #define TR_VRFY()       tr_vrfy()
64 #endif
65
66 #endif /* TRVRFY_H */