cleaned up doxygen comments
[libfirm] / ir / ir / irflag_t.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief    Flags to control optimizations, inline implementation.
23  * @author   Michael Beck
24  * @version  $Id$
25  */
26 #ifndef FIRM_IR_IRFLAG_T_H
27 #define FIRM_IR_IRFLAG_T_H
28
29 #include "irflag.h"
30
31 /**
32  * current libFIRM optimizations
33  */
34 typedef enum {
35 #define E_FLAG(name, value, def)        irf_##name = (1 << value),
36 #define I_FLAG(name, value, def)        irf_##name = (1 << value),
37
38 #include "irflag_t.def"
39         irf_last
40 #undef I_FLAG
41 #undef E_FLAG
42 } libfirm_opts_t;
43
44 extern optimization_state_t libFIRM_opt;
45 extern optimization_state_t libFIRM_verb;
46 extern firm_verification_t opt_do_node_verification;
47
48 extern int firm_verbosity_level;
49
50 /** initialises the flags */
51 void firm_init_flags(void);
52
53 /* generate the getter functions for external access */
54 #define E_FLAG(name, value, def)                    \
55 static INLINE int _get_opt_##name(void) {           \
56   return libFIRM_opt & irf_##name;                  \
57 }                                                   \
58 static INLINE int get_opt_##name##_verbose(void) {  \
59   return libFIRM_verb & irf_##name;                 \
60 }
61
62 /* generate the getter functions for internal access */
63 #define I_FLAG(name, value, def)                   \
64 static INLINE int get_opt_##name(void) {           \
65   return libFIRM_opt & irf_##name;                 \
66 }                                                  \
67 static INLINE int get_opt_##name##_verbose(void) { \
68   return libFIRM_verb & irf_##name;                \
69 }
70
71 #include "irflag_t.def"
72
73 #undef I_FLAG
74 #undef E_FLAG
75
76 static INLINE int _get_firm_verbosity (void) {
77         return firm_verbosity_level;
78 }
79
80 static INLINE int _get_optimize (void) {
81   return get_opt_optimize();
82 }
83
84 static INLINE firm_verification_t
85 get_node_verification_mode(void) {
86   return opt_do_node_verification;
87 }
88
89 #define get_optimize()                           _get_optimize()
90 #define get_opt_cse()                            _get_opt_cse()
91 #define get_firm_verbosity()                     _get_firm_verbosity()
92 #define get_opt_dyn_meth_dispatch()              _get_opt_dyn_meth_dispatch()
93 #define get_opt_optimize_class_casts()           _get_opt_optimize_class_casts()
94 #define get_opt_suppress_downcast_optimization() _get_opt_suppress_downcast_optimization()
95
96 extern void firm_init_flags(void);
97
98 #endif