fix things when WITH_JVM and WITH_ILP is defined
[libfirm] / ir / be / bespillremat.c
index e1d7596..f4216c3 100644 (file)
@@ -157,11 +157,17 @@ static const lc_opt_table_entry_t options[] = {
        { NULL }
 };
 
-void be_spill_remat_register_options(lc_opt_entry_t *grp)
+void be_init_spillremat(void)
 {
-       lc_opt_entry_t *my_grp = lc_opt_get_grp(grp, "remat");
-       lc_opt_add_table(my_grp, options);
+       lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
+       lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
+       lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
+       lc_opt_entry_t *remat_grp = lc_opt_get_grp(chordal_grp, "remat");
+
+       lc_opt_add_table(remat_grp, options);
 }
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillremat);
 #endif
 
 
@@ -3401,16 +3407,14 @@ connect_all_spills_with_keep(spill_ilp_t * si)
 /** insert a spill at an arbitrary position */
 ir_node *be_spill2(const arch_env_t *arch_env, ir_node *irn, ir_node *insert)
 {
-       ir_node *bl     = is_Block(insert)?insert:get_nodes_block(insert);
+       ir_node  *bl    = is_Block(insert)?insert:get_nodes_block(insert);
        ir_graph *irg   = get_irn_irg(bl);
-       ir_node *frame  = get_irg_frame(irg);
-       ir_node *spill;
-       ir_node *next;
-
-       const arch_register_class_t *cls       = arch_get_irn_reg_class(arch_env, irn, -1);
-       const arch_register_class_t *cls_frame = arch_get_irn_reg_class(arch_env, frame, -1);
+       ir_node  *frame = get_irg_frame(irg);
+       ir_node  *spill;
+       ir_node  *next;
+       const arch_register_class_t *cls = arch_get_irn_reg_class(arch_env, irn, -1);
 
-       spill = be_new_Spill(cls, cls_frame, irg, bl, frame, irn);
+       spill = be_new_Spill(cls, irg, bl, irn);
 
        /*
         * search the right insertion point. a spill of a phi cannot be put
@@ -3424,7 +3428,7 @@ ir_node *be_spill2(const arch_env_t *arch_env, ir_node *irn, ir_node *insert)
         * which is its default initialization (see above).
         */
 
-       if(bl == get_irg_start_block(irg) && sched_get_time_step(frame) >= sched_get_time_step(insert))
+       if (bl == get_irg_start_block(irg) && sched_get_time_step(frame) >= sched_get_time_step(insert))
                insert = frame;
 
        for (next = sched_next(insert); is_Phi(next) || is_Proj(next); next = sched_next(insert))
@@ -4538,7 +4542,7 @@ be_spill_remat(const be_chordal_env_t * chordal_env)
 
 #else                          /* WITH_ILP */
 
-static void
+static void INLINE
 only_that_you_can_compile_without_WITH_ILP_defined(void)
 {
 }