- fixed warnings
[libfirm] / ir / common / firm.c
index ff38ac3..2328583 100644 (file)
 #include "funccall_t.h"
 #include "irhooks.h"
 #include "iredges_t.h"
+#include "tropt.h"
 #include "debugger.h"
+#include "be_t.h"
 
 /* returns the firm root */
 lc_opt_entry_t *firm_opt_get_root(void) {
        static lc_opt_entry_t *grp = NULL;
-       if(!grp)
+       if (!grp)
                grp = lc_opt_get_grp(lc_opt_root_grp(), "firm");
        return grp;
 }
@@ -83,6 +85,9 @@ void init_firm(const firm_parameter_t *param)
        firm_parameter_t def_params;
        unsigned int     size;
 
+       /* for historical reasons be_init must be run first */
+       firm_be_init();
+
        memset(&def_params, 0, sizeof(def_params));
 
        if (param) {
@@ -141,6 +146,8 @@ void init_firm(const firm_parameter_t *param)
        firm_init_entity();
        /* allocate a hash table. */
        init_type_identify(def_params.ti_if);
+       /* class cast optimization */
+       firm_init_class_casts_opt();
 
        /* Init architecture dependent optimizations. */
        arch_dep_init(arch_dep_default_factory);