+#ifdef WITH_LIBCORE
+ lc_timer_t *t = NULL;
+
+ /* The user specified another config file to read. do that now. */
+ if(strlen(config_file) > 0) {
+ FILE *f;
+
+ if((f = fopen(config_file, "rt")) != NULL) {
+ lc_opt_from_file(config_file, f, NULL);
+ fclose(f);
+ }
+ }
+
+ if (be_options.timing == BE_TIME_ON) {
+ t = lc_timer_register("bemain", "measure complete bemain loop");
+
+ if (lc_timer_enter_high_priority()) {
+ fprintf(stderr, "Warning: Could not enter high priority mode.\n");
+ }
+
+ lc_timer_reset_and_start(t);
+ }
+
+#ifdef FIRM_STATISTICS
+ be_init_stat_file(be_options.stat_file_name, cup_name);
+#endif
+#endif /* WITH_LIBCORE */
+
+ /* never build code for pseudo irgs */
+ set_visit_pseudo_irgs(0);
+
+ be_node_init();
+
+ be_main_loop(file_handle, cup_name);
+
+#ifdef WITH_LIBCORE
+ if (be_options.timing == BE_TIME_ON) {
+ lc_timer_stop(t);
+ lc_timer_leave_high_priority();
+ if(be_stat_ev_is_active()) {
+ be_stat_ev_l("backend_time", lc_timer_elapsed_msec(t));
+ } else {
+ printf("%-20s: %lu msec\n", "BEMAINLOOP", lc_timer_elapsed_msec(t));
+ }
+ }
+
+#ifdef FIRM_STATISTICS
+ be_close_stat_file();
+#endif
+#endif /* WITH_LIBCORE */
+}
+
+/** The debug info retriever function. */
+static retrieve_dbg_func retrieve_dbg = NULL;
+
+/* Sets a debug info retriever. */
+void be_set_debug_retrieve(retrieve_dbg_func func) {
+ retrieve_dbg = func;
+}
+
+/* Retrieve the debug info. */
+const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line) {
+ if (retrieve_dbg)
+ return retrieve_dbg(dbg, line);
+
+ *line = 0;
+ return NULL;
+}
+
+int be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls, bitset_t *bs)
+{
+ if(bs == NULL)
+ bs = bitset_alloca(cls->n_regs);
+ else
+ bitset_clear_all(bs);
+
+ assert(bitset_size(bs) == (unsigned) cls->n_regs);
+ arch_put_non_ignore_regs(birg->main_env->arch_env, cls, bs);
+ bitset_flip_all(bs);
+ be_abi_put_ignore_regs(birg->abi, cls, bs);
+
+ return bitset_popcnt(bs);