-void restore_optimization_state(const optimization_state_t *state)
-{
- libFIRM_opt = *state;
-}
-
-/* repeat 'inline' methods here */
-
-# ifndef USE_GCC_INLINE
-
-/** Returns constant folding optimization setting. */
-int get_opt_cse(void) /* iropt.c */
-{
- return libFIRM_opt & OPT_CSE;
-}
-
-/** Returns constant subexpression elimination setting. */
-int get_opt_global_cse(void) /* irgopt.c iropt.c */
-{
- return libFIRM_opt & OPT_GLOBAL_CSE;
-}
-
-/** Returns global constant subexpression elimination setting. */
-int get_opt_constant_folding(void) /* iropt.c */
-{
- return libFIRM_opt & OPT_CONSTANT_FOLDING;
-}
-
-/** Returns unreachable code elimination setting. */
-int get_opt_unreachable_code(void) /* iropt.c */
-{
- return libFIRM_opt & OPT_UNREACHABLE_CODE;
-}
-
-/** Returns Straightening setting. */
-int get_opt_control_flow_straightening(void) /* iropt.c, irgopt.c */
-{
- return libFIRM_opt & OPT_CONTROL_FLOW_STRAIGHTENING;
-}
-
-/** Returns if simplifications in local optimizations setting. */
-int get_opt_control_flow_weak_simplification(void) /* iropt.c, irgopt.c */
-{
- return libFIRM_opt & OPT_CONTROL_FLOW_WEAK_SIMPLIFICATION;
-}
-
-/** Returns strong if and loop simplification setting */
-int get_opt_control_flow_strong_simplification(void) /* irgopt.c */
-{
- return libFIRM_opt & OPT_CONTROL_FLOW_STRONG_SIMPLIFICATION;
-}
-
-/** Returns whether critical edges are removed */
-int get_opt_critical_edges(void) /* irgopt.c */
-{
- return libFIRM_opt & OPT_CRITICAL_EDGES;
-}
-
-/** Returns reassociation setting. */
-int get_opt_reassociation(void) /* iropt.c */
-{
- return libFIRM_opt & OPT_REASSOCIATION;
-}
-
-/** Returns dead node elimination setting. */
-int get_opt_dead_node_elimination(void) /* irgopt.c */
-{
- return libFIRM_opt & OPT_DEAD_NODE_ELIMINATION;
+void restore_optimization_state(const optimization_state_t *state) {
+ libFIRM_opt = *state;
+}
+
+/* Switches ALL optimizations off */
+void all_optimizations_off(void) {
+ libFIRM_opt = 0;
+}
+
+#ifdef _DEBUG
+/* only for debugging */
+void firm_show_flags(FILE *f) {
+ if (! f)
+ f = stdout;
+ printf("Firm optimization state:\n");
+#define E_FLAG(name, value, def) printf(" %-20s = %s\n", #name, get_opt_##name() ? "ON" : "OFF");
+#define I_FLAG(name, value, def) printf(" %-20s = %s\n", #name, get_opt_##name() ? "ON" : "OFF");
+#define R_FLAG(name, value) printf(" %-20s = %s\n", #name, is_##name##_running() ? "is running" : "not running");
+#include "irflag_t.def"
+#undef I_FLAG
+#undef E_FLAG
+#undef R_FLAG
+ printf("\n");