#ifdef WITH_LIBCORE
int i;
lc_opt_entry_t *be_grp_ra;
-
- be_grp_root = lc_opt_get_grp(firm_opt_get_root(), "be");
- be_grp_ra = lc_opt_get_grp(be_grp_root, "ra");
-
- lc_opt_add_table(be_grp_root, be_main_options);
-
- /* register allocator options */
- for(i = 0; ra_items[i].name != NULL; ++i) {
- const be_ra_t *ra = ra_items[i].value;
- ra->register_options(be_grp_ra);
+ static int run_once = 0;
+
+ if (! run_once) {
+ run_once = 1;
+ be_grp_root = lc_opt_get_grp(firm_opt_get_root(), "be");
+ be_grp_ra = lc_opt_get_grp(be_grp_root, "ra");
+
+ lc_opt_add_table(be_grp_root, be_main_options);
+
+ /* register allocator options */
+ for(i = 0; ra_items[i].name != NULL; ++i) {
+ const be_ra_t *ra = ra_items[i].value;
+ ra->register_options(be_grp_ra);
+ }
+
+ /* register isa options */
+ for(i = 0; isa_items[i].name != NULL; ++i) {
+ const arch_isa_if_t *isa = isa_items[i].value;
+ isa->register_options(be_grp_root);
+ }
}
+#endif /* WITH_LIBCORE */
+}
- /* register isa options */
- for(i = 0; isa_items[i].name != NULL; ++i) {
- const arch_isa_if_t *isa = isa_items[i].value;
- isa->register_options(be_grp_root);
- }
+/* Parse one argument. */
+int be_parse_arg(const char *arg) {
+#ifdef WITH_LIBCORE
+ return lc_opt_from_single_arg(be_grp_root, NULL, arg, NULL);
#endif /* WITH_LIBCORE */
}
}
static void dump(int mask, ir_graph *irg, const char *suffix,
- void (*dumper)(ir_graph *, const char *))
+ void (*dumper)(ir_graph *, const char *))
{
if(dump_flags & mask)
be_dump(irg, suffix, dumper);
isa = arch_env_get_isa(env.arch_env);
/* For all graphs */
- for(i = 0, n = get_irp_n_irgs(); i < n; ++i) {
+ for (i = 0, n = get_irp_n_irgs(); i < n; ++i) {
ir_graph *irg = get_irp_irg(i);
const arch_code_generator_if_t *cg_if;
be_irg_t birg;
dump(DUMP_PREPARED, irg, "-prepared", dump_ir_block_graph);
/* add Keeps for should_be_different constrained nodes */
- // assure_constraints(&birg);
+ assure_constraints(&birg);
dump(DUMP_PREPARED, irg, "-assured", dump_ir_block_graph);
/* Schedule the graphs. */
arch_code_generator_done(birg.cg);
dump(DUMP_FINAL, irg, "-end", dump_ir_block_graph_sched);
be_abi_free(birg.abi);
+
+ free_ir_graph(irg);
}
be_done_env(&env);