3 * File name: ir/ir/irgraph.c
4 * Purpose: Flags to control optimizations, inline implementation.
8 * Copyright: (c) 1998-2004 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
15 * Inline implementation of Optimization flags.
17 * @author Michael Beck
25 * current libFIRM optimizations
28 #define E_FLAG(name, value, def) irf_##name = (1 << value),
29 #define I_FLAG(name, value, def) irf_##name = (1 << value),
31 #include "irflag_t.def"
37 extern optimization_state_t libFIRM_opt;
38 extern optimization_state_t libFIRM_verb;
40 extern int firm_verbosity_level;
42 /** initialises the flags */
43 void firm_init_flags(void);
45 /* generate the getter functions for external access */
46 #define E_FLAG(name, value, def) \
47 static INLINE int _get_opt_##name(void) { \
48 return libFIRM_opt & irf_##name; \
50 static INLINE int get_opt_##name##_verbose(void) { \
51 return libFIRM_verb & irf_##name; \
54 /* generate the getter functions for internal access */
55 #define I_FLAG(name, value, def) \
56 static INLINE int get_opt_##name(void) { \
57 return libFIRM_opt & irf_##name; \
59 static INLINE int get_opt_##name##_verbose(void) { \
60 return libFIRM_verb & irf_##name; \
63 #include "irflag_t.def"
68 static INLINE int _get_firm_verbosity (void) {
69 return firm_verbosity_level;
72 static INLINE int _get_optimize (void) {
73 return get_opt_optimize();
76 #define get_optimize() _get_optimize()
77 #define get_opt_cse() _get_opt_cse()
78 #define get_firm_verbosity() _get_firm_verbosity()
79 #define get_opt_dyn_meth_dispatch() _get_opt_dyn_meth_dispatch()
80 #define get_opt_optimize_class_casts() _get_opt_optimize_class_casts()
81 #define get_opt_suppress_downcast_optimization() _get_opt_suppress_downcast_optimization()
83 #endif /* _IRFLAG_T_H_ */