removed critical_edges flag. Other code depends on remove_critical_edges() doing...
[libfirm] / ir / ir / irflag_t.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/irgraph.c
4  * Purpose:     Flags to control optimizations, inline implementation.
5  * Author:      Michael Beck
6  * Created:
7  * CVS-ID:      $Id$
8  * Copyright:   (c) 1998-2004 Universität Karlsruhe
9  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
10  */
11
12 /**
13  * @file irflag_t.h
14  *
15  * Inline implementation of Optimization flags.
16  *
17  * @author Michael Beck
18  */
19 #ifndef _IRFLAG_T_H_
20 #define _IRFLAG_T_H_
21
22 #include "irflag.h"
23
24 /**
25  * current libFIRM optimizations
26  */
27 typedef enum {
28 #define E_FLAG(name, value, def)        irf_##name = (1 << value),
29 #define I_FLAG(name, value, def)        irf_##name = (1 << value),
30
31 #include "irflag_t.def"
32         irf_last
33 #undef I_FLAG
34 #undef E_FLAG
35 } libfirm_opts_t;
36
37 extern optimization_state_t libFIRM_opt;
38 extern optimization_state_t libFIRM_verb;
39 extern firm_verification_t opt_do_node_verification;
40
41 extern int firm_verbosity_level;
42
43 /** initialises the flags */
44 void firm_init_flags(void);
45
46 /* generate the getter functions for external access */
47 #define E_FLAG(name, value, def)                    \
48 static INLINE int _get_opt_##name(void) {           \
49   return libFIRM_opt & irf_##name;                  \
50 }                                                   \
51 static INLINE int get_opt_##name##_verbose(void) {  \
52   return libFIRM_verb & irf_##name;                 \
53 }
54
55 /* generate the getter functions for internal access */
56 #define I_FLAG(name, value, def)                   \
57 static INLINE int get_opt_##name(void) {           \
58   return libFIRM_opt & irf_##name;                 \
59 }                                                  \
60 static INLINE int get_opt_##name##_verbose(void) { \
61   return libFIRM_verb & irf_##name;                \
62 }
63
64 #include "irflag_t.def"
65
66 #undef I_FLAG
67 #undef E_FLAG
68
69 static INLINE int _get_firm_verbosity (void) {
70         return firm_verbosity_level;
71 }
72
73 static INLINE int _get_optimize (void) {
74   return get_opt_optimize();
75 }
76
77 static INLINE firm_verification_t
78 get_node_verification_mode(void) {
79   return opt_do_node_verification;
80 }
81
82 #define get_optimize()                           _get_optimize()
83 #define get_opt_cse()                            _get_opt_cse()
84 #define get_firm_verbosity()                     _get_firm_verbosity()
85 #define get_opt_dyn_meth_dispatch()              _get_opt_dyn_meth_dispatch()
86 #define get_opt_optimize_class_casts()           _get_opt_optimize_class_casts()
87 #define get_opt_suppress_downcast_optimization() _get_opt_suppress_downcast_optimization()
88
89 extern void firm_init_flags(void);
90
91 #endif /* _IRFLAG_T_H_ */