- no more be_init(): backend is initialised in init_firm
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 30 May 2008 14:51:08 +0000 (14:51 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 30 May 2008 14:51:08 +0000 (14:51 +0000)
[r19852]

include/libfirm/be.h
ir/be/be_t.h
ir/common/firm.c

index 56c9dff..0d01226 100644 (file)
@@ -73,12 +73,12 @@ void be_opt_register(void);
 int be_parse_arg(const char *arg);
 
 /**
- * Initialize the Firm backend. Must be run BEFORE init_firm()!
+ * Return the backend configuration parameter.
  *
  * @return libFirm configuration parameters for the selected
  *         backend
  */
-const backend_params *be_init(void);
+const backend_params *be_get_backend_param(void);
 
 /**
  * Main interface to the frontend.
index eccf7cd..9ecee74 100644 (file)
@@ -91,15 +91,21 @@ struct be_main_env_t {
 };
 
 /**
-* Put the registers to be ignored in this IRG into a bitset.
-* @param birg The backend IRG data structure.
-* @param cls  The register class.
-* @param bs   The bitset (may be NULL).
-* @return The number of registers to be ignored.
-*/
+ * Put the registers to be ignored in this IRG into a bitset.
+ * @param birg The backend IRG data structure.
+ * @param cls  The register class.
+ * @param bs   The bitset (may be NULL).
+ * @return The number of registers to be ignored.
+ */
 unsigned be_put_ignore_regs(const be_irg_t *birg,
                const arch_register_class_t *cls, bitset_t *bs);
 
+
+/**
+ * Initialize the backend. Must be run first in init_firm();
+ */
+void firm_be_init(void);
+
 extern int be_timing;
 
 #define BE_TIMER_PUSH(timer)                                              \
index b2fd415..2328583 100644 (file)
 #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;
 }
@@ -84,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) {