-void set_opt_inline(int value)
-{
- if (value)
- libFIRM_opt |= OPT_INLINE;
- else
- libFIRM_opt &= ~OPT_INLINE;
+/* Restore the current optimization state. */
+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");