#include "debug.h"
#include "execfreq.h"
#include "iredges_t.h"
+#include "error.h"
#include "bechordal_t.h"
#include "beabi.h"
#include "be_t.h"
#include "bera.h"
#include "beirg.h"
+#include "bedump_minir.h"
#include "bespillslots.h"
#include "bespill.h"
&options.vrfy_option, be_ch_vrfy_items
};
+static char minir_file[256] = "";
+
static const lc_opt_table_entry_t be_chordal_options[] = {
LC_OPT_ENT_ENUM_PTR ("perm", "perm lowering options", &lower_perm_var),
LC_OPT_ENT_ENUM_MASK("dump", "select dump phases", &dump_var),
LC_OPT_ENT_ENUM_PTR ("verify", "verify options", &be_ch_vrfy_var),
+ LC_OPT_ENT_STR ("minirout", "dump MinIR to file", minir_file, sizeof(minir_file)),
LC_OPT_LAST
};
}
be_timer_push(T_RA_COPYMIN);
+ if (minir_file[0] != '\0') {
+ FILE *out;
+
+ if (strcmp(minir_file, "-") == 0) {
+ out = stdout;
+ } else {
+ out = fopen(minir_file, "w");
+ if (out == NULL) {
+ panic("Cound't open minir output '%s'", minir_file);
+ }
+ }
+
+ be_export_minir(chordal_env->birg->main_env->arch_env, out, irg);
+ if (out != stdout)
+ fclose(out);
+ }
co_driver(chordal_env);
be_timer_pop(T_RA_COPYMIN);