- obstack_init(&env->obst);
- env->dbg = firm_dbg_register("be.main");
-
- env->arch_env = obstack_alloc(&env->obst, sizeof(env->arch_env[0]));
- arch_env_init(env->arch_env, isa_if, file_handle);
-
- /* Register the irn handler of the architecture */
- if (arch_isa_get_irn_handler(env->arch_env->isa))
- arch_env_add_irn_handler(env->arch_env, arch_isa_get_irn_handler(env->arch_env->isa));
-
- /*
- * Register the node handler of the back end infrastructure.
- * This irn handler takes care of the platform independent
- * spill, reload and perm nodes.
- */
- env->node_factory = obstack_alloc(&env->obst, sizeof(*env->node_factory));
- be_node_factory_init(env->node_factory, env->arch_env->isa);
- arch_env_add_irn_handler(env->arch_env, be_node_get_irn_handler(env->node_factory));
-
- return env;
+ memset(env, 0, sizeof(*env));
+ obstack_init(&env->obst);
+ env->dbg = firm_dbg_register("be.main");
+ env->arch_env = obstack_alloc(&env->obst, sizeof(env->arch_env[0]));
+ env->options = &be_options;
+
+ arch_env_init(env->arch_env, isa_if);
+
+ /* Register the irn handler of the architecture */
+ if (arch_isa_get_irn_handler(env->arch_env->isa))
+ arch_env_push_irn_handler(env->arch_env, arch_isa_get_irn_handler(env->arch_env->isa));
+
+ /*
+ * Register the node handler of the back end infrastructure.
+ * This irn handler takes care of the platform independent
+ * spill, reload and perm nodes.
+ */
+ arch_env_push_irn_handler(env->arch_env, &be_node_irn_handler);
+ env->phi_handler = be_phi_handler_new(env->arch_env);
+ arch_env_push_irn_handler(env->arch_env, env->phi_handler);
+
+ return env;